File tree 2 files changed +3
-2
lines changed
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ def quantize_impl(
184
184
# NOTE: We set the config here to properly save/load the quantized model during training into tf.train.Checkpoint.
185
185
# You can obtain that config via the nncf.tensorflow.get_config() method and save/load it to/from
186
186
# 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" ]
188
188
setattr (compressed_model , "_nncf_config" , config )
189
189
190
190
return compressed_model
Original file line number Diff line number Diff line change @@ -106,9 +106,10 @@ def serialize(self) -> str:
106
106
107
107
:return: A serialized config.
108
108
"""
109
+ quantizer_setup_state = self .config ["quantization" ]["quantizer_setup" ]
109
110
data = {
110
111
"quantization" : {
111
- "quantizer_setup" : TFQuantizationSetup .from_state (self . config [ "quantizer_setup" ] ).get_state (),
112
+ "quantizer_setup" : TFQuantizationSetup .from_state (quantizer_setup_state ).get_state (),
112
113
}
113
114
}
114
115
return json .dumps (data )
You can’t perform that action at this time.
0 commit comments