Skip to content

Latest commit

 

History

History
93 lines (76 loc) · 3.38 KB

File metadata and controls

93 lines (76 loc) · 3.38 KB

ResNet101 Int8 inference

Description

This document has instructions for running ResNet101 Int8 inference using Intel-optimized TensorFlow.

Datasets

Download and preprocess the ImageNet dataset using the instructions here. After running the conversion script you should have a directory with the ImageNet dataset in the TF records format.

Set the DATASET_DIR to point to this directory when running ResNet101.

Quick Start Scripts

Script name Description
int8_online_inference.sh Runs online inference (batch_size=1).
int8_batch_inference.sh Runs batch inference (batch_size=128).
int8_accuracy.sh Measures the model accuracy (batch_size=100).

Run the model

Setup your environment using the instructions below, depending on if you are using AI Kit:

Setup using AI Kit Setup without AI Kit

To run using AI Kit you will need:

  • numactl
  • wget
  • Activate the tensorflow conda environment
    conda activate tensorflow

To run without AI Kit you will need:

After finishing the setup above, download the pretrained model and set the PRETRAINED_MODEL environment var to the path to the frozen graph:

wget https://storage.googleapis.com/intel-optimized-tensorflow/models/v1_8/resnet101_int8_pretrained_model.pb
export PRETRAINED_MODEL=$(pwd)/resnet101_int8_pretrained_model.pb

Set environment variables for the path to your DATASET_DIR for ImageNet and an OUTPUT_DIR where log files will be written. Navigate to your model zoo directory and then run a quickstart script.

# cd to your model zoo directory
cd models

export PRETRAINED_MODEL=<path to the frozen graph downloaded above>
export DATASET_DIR=<path to the ImageNet TF records>
export OUTPUT_DIR=<directory where log files will be written>

./quickstart/image_recognition/tensorflow/resnet101/inference/cpu/int8/<script name>.sh

Additional Resources