tensorflow / model-optimization

A toolkit to optimize ML models for deployment for Keras and TensorFlow, including quantization and pruning.
https://www.tensorflow.org/model_optimization
Apache License 2.0
1.49k stars 319 forks source link

model written with tf2.6.0 (not using keras) cannot find instructions to do quantization aware training, only keras model based quantization example can be found #811

Open SkylerZheng opened 3 years ago

SkylerZheng commented 3 years ago

I wrote my code with tensorflow 2.0, some of my code used tf.compat.v1, I'm trying to do quantization aware training for my model, however, I cannot find any functions except keras related quantization functions. My question is to do quantization aware training, do I have to write my model using Keras?

abattery commented 3 years ago

Current QAT feature is based on the Keras API. See the following document as well:

https://www.tensorflow.org/model_optimization/guide/quantization/training