This document is used to list steps of reproducing TensorFlow keras Intel® Neural Compressor QAT conversion.
# Install Intel® Neural Compressor
pip install neural-compressorpip install intel-tensorflow==2.4.0
pip install tensorflow_model_optimization==0.5.0Note: To generate correct qat model with tensorflow_model_optimization 0.5.0, pls use TensorFlow 2.4 or above.
Run the train.py script to get pretrained fp32 model.
Run the qat.py script to get QAT model which in fact is a fp32 model with quant/dequant pair inserted.
python convert.py # to convert QAT model to quantized model.
python benchmark.py # to run accuracy benchmark.