Guidance for Compiling TensorFlow™ Model Zoo Networks

You can easily compile models from the TensorFlow™ Model Zoo for use with the Intel® Movidius™ Neural Compute SDK (Intel® Movidius™ NCSDK) and Neural Compute API using scripts provided by TensorFlow™.

This diagram shows an overview of the process of converting the TensorFlow™ model to a Movidius™ graph file:

General Steps

Clone TensorFlow™ source code and TensorFlow™ model repositories

git clone
git clone 

Download and extract the checkpoint file

wget -nc<name of model tar file>.tar.gz
tar -xvf <name of model tar file>.tar.gz

Export GraphDef file

python3 <path to TF models repo>/research/slim/ \
		--alsologtostderr \
		--model_name=<the name of the model> \
		--batch_size=1 \
		--dataset_name=<the name of the dataset> \
		--image_size=<one dimension of image size> \
		--output_file=<the name of the model>.pb

Freeze model for inference

python3 <path to TF source repo>/tensorflow/python/tools/ \
		--input_graph=<the name of the model>.pb \
		--input_binary=true \
		--input_checkpoint=<the name of the model>.ckpt \
		--output_graph=<the name of the model>_frozen.pb \
		--output_node_name=<name of the output node>

Compile the Movidius™ graph file

mvNCCompile -s <number of shaves> <name of the model>_frozen.pb -in=input -on=<name of the output node>

Example Using Inception v3 Model

This example shows the above steps for compiling the Inception v3 model for use with the NCSDK.

Download and extract the checkpoint file:

git clone
git clone

Make a directory for the model:

mkdir -p inception_v3
cd inception_v3

Download and extract the checkpoint file:

wget -nc
tar -xvf inception_v3_2016_08_28.tar.gz

Export the GraphDef file:

python3 ../models/research/slim/ \
		--alsologtostderr \
		--model_name=inception_v3 \
		--batch_size=1 \
		--dataset_name=imagenet \
		--image_size=299 \

Freeze model for inference:

python3 ../tensorflow/tensorflow/python/tools/ \
		--input_graph=inception_v3.pb \
		--input_binary=true \
		--input_checkpoint=inception_v3.ckpt \
		--output_graph=inception_v3_frozen.pb \

Compile the Movidius™ graph file:

mvNCCompile -s 12 inception_v3_frozen.pb -in=input -on=InceptionV3/Predictions/Reshape_1