After QAT training with tensorflow_model_optimization followed the tutorial
then use Keras to load the quantized model will show Unknown layer: QuantizeLayer
tf.keras.models.load_model(keras_quantized_model_file)
After QAT training with tensorflow_model_optimization followed the tutorial
then use Keras to load the quantized model will show Unknown layer: QuantizeLayer
tf.keras.models.load_model(keras_quantized_model_file)
The problem solved by the following code:
import tensorflow_model_optimization as tfmot
with tfmot.quantization.keras.quantize_scope():
loaded_model = tf.keras.models.load_model(keras_quantized_model_file)