This example is used to demonstrate how to quantize a TensorFlow model with pure python API.
pip install -r requirements.txt
wget https://storage.googleapis.com/intel-optimized-tensorflow/models/v1_6/mobilenet_v1_1.0_224_frozen.pb
python test.py
We can create a quantizer without config yaml, only need to set the dataloader with dummy dataset to generate an int8 model.
quantizer = Quantization()
quantizer.model = './mobilenet_v1_1.0_224_frozen.pb'
dataset = quantizer.dataset('dummy', shape=(20, 224, 224, 3))
quantizer.calib_dataloader = common.DataLoader(dataset)
quantized_model = quantizer.fit()