Quantizing the model - 3.0 English

Vitis AI User Guide (UG1414)

Document ID
UG1414
Release Date
2023-02-24
Version
3.0 English
  • Prepare dataset. For tf_resnet50 model, download the calibration images from Imagenet_calib.tar.gz, and copy into Vitis-AI folder (Full dataset is from ImageNet).
  • Launch the docker image.
    [Host]$ ./docker_run.sh xilinx/vitis-ai-tensorflow-cpu:latest
  • Quantize the model.
    Set CALIB_BATCH_SIZE in the tf_resnetv1_50_imagenet_224_224_6.97G_3.0/code/quantize/config.ini to 5. Then run
    
    [Docker]$ conda activate vitis-ai-tensorflow
    [Docker]$ tar -xzvf Imagenet_calib.tar.gz -C tf_resnetv1_50_imagenet_224_224_6.97G_3.0/data
    [Docker]$ cd tf_resnetv1_50_imagenet_224_224_6.97G_3.0/code/quantize
    [Docker]$ bash quantize.sh

After running quantize.sh, the quantized model are available in tf_resnetv1_50_imagenet_224_224_6.97G_3.0/quantized