Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Step-by-Step

This document is used to list steps of reproducing Intel® Neural Compressor QAT feature on intel CPU.

Note: Most of those models are both supported in Intel optimized TF 1.15.x and Intel optimized TF 2.x. Validated TensorFlow Version.

Prerequisite

1. Environment

Install Intel® Neural Compressor

pip install neural-compressor

Installation Dependency packages

pip install -r requirements.txt

Install Intel Extension for Tensorflow

Intel Extension for Tensorflow is mandatory to be installed to run this QAT example.

pip install intel-extension-for-tensorflow[cpu]

Note: The version compatibility of stock Tensorflow and ITEX can be checked here. Please make sure you have installed compatible Tensorflow and ITEX.

Run

The baseline model will be generated and pretrained on CIFAR10 dataset. Then, it will be saved to "./baseline_model". The CIFAR10 dataset will be automatically loaded. To apply QAT, run the command below:

1. Quantization

bash run_quant.sh --output_model=/path/to/output_model

2. Benchmark

Performance

bash run_benchmark.sh --input_model=/path/to/input_model --mode=performance

Accuracy

bash run_benchmark.sh --input_model=/path/to/input_model --mode=accuracy