How to apply quantization aware training on keras model?
The typical approach consists of taking a keras model and pass it to tfmot.quantization.keras.quantize_model()
This approach does not work in case of efficientdet keras model. I got a value error :
ValueError: to_quantize can only either be a tf.keras Sequential or Functional model.
cause the model class is neither Sequential no Functional typical keras model. It seems more like class aggregating different part and each part is a class inherited from tf.keras.model.
I am not an expert in Keras and would appreciate any hint to guide me for running a qat with efficientdet.
in tf2/train.py
I added the following code lines in setup_model function
quantize_model = tfmopt.quantization.keras.quantize_model #qaware stands for for quantization aware. model.build((None, *config.image_size, 3)) print(type(model)) model_quant = quantize_model(model)
@drahmad89 Any luck on getting answers to your questions in this issue? Can we quantize or prune Efficientdet models?