Skip to content

Commit 84896d7

Browse files
update
1 parent 1c51fd8 commit 84896d7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

nncf/tensorflow/quantization/quantize_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def quantize_impl(
184184
# NOTE: We set the config here to properly save/load the quantized model during training into tf.train.Checkpoint.
185185
# You can obtain that config via the nncf.tensorflow.get_config() method and save/load it to/from
186186
# tf.train.Checkpoint using the nncf.tensorflow.ConfigState class.
187-
config = compression_ctrl.get_compression_state()["builder_state"]["quantization"]
187+
config = compression_ctrl.get_compression_state()["builder_state"]
188188
setattr(compressed_model, "_nncf_config", config)
189189

190190
return compressed_model

nncf/tensorflow/utils/state.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ def serialize(self) -> str:
106106
107107
:return: A serialized config.
108108
"""
109+
quantizer_setup_state = self.config["quantization"]["quantizer_setup"]
109110
data = {
110111
"quantization": {
111-
"quantizer_setup": TFQuantizationSetup.from_state(self.config["quantizer_setup"]).get_state(),
112+
"quantizer_setup": TFQuantizationSetup.from_state(quantizer_setup_state).get_state(),
112113
}
113114
}
114115
return json.dumps(data)

0 commit comments

Comments
 (0)