inception_v3
Introduction
Inception is a deep convolutional neural network (CNN) architecture designed by Google during the ImageNet Large-Scale Visual Recognition Challenge 2014 (ILSVRC2014). The main goal behind this model is to improve accuracy by increasing depth and width of the network without affecting the computational requirements. However, the latency of inception based models like GoogLeNet, Inception V1, V2, V3 and V4 is much larger than that of MobileNets.
TensorFlow™ provides different versions of pre-trained inception models trained on ImageNet. The Makefile in this project helps convert these TensorFlow Inception models to an IR format file (Intermediate Representation), which can be deployed on to the Intel® Neural Compute Stick (NCS1/NCS2) for inference.
Prerequisites
This code example requires that the following components are available:
- Intel Neural Compute Stick
- Intel OpenVINO 2020.1 Toolkit
- TensorFlow source repo
- TensorFlow models repo
This sample utilizes the OpenVINO Inference Engine from the OpenVINO Deep Learning Development Toolkit and was tested with the 2020.1 release.
Model Information
Inputs
- name: ‘input’, shape: [1x3x299x299], Expected color order is BGR. Original model expects RGB, but IR is compiled with the –reverse_input_channels option to convert the IR to expect the BGR color order.
Outputs
- name: ‘InceptionV3/Predictions/Softmax’, shape: [1, 1001] - Output indexes represent each class probability. This model includes the background class but it is not used for this sample.
Running this Example
You can run the sample with the command:
make run
Compiling the models
You can compile the model to an IR using the command:
make compile_model
Makefile
Provided Makefile describes various targets that help with the above mentioned tasks.
make run or make run_py
Runs a sample application with the network.
make cpp
Builds the C++ example program run_cpp which can be executed with make run_cpp.
make run_cpp
Runs the provided run_cpp executable program that is built via make cpp. This program sends a single image to the Neural Compute Stick and receives and displays the inference results.
make help
Shows makefile possible targets and brief descriptions.
make all
Makes the follow items: deps, data, compile_model, compile_cpp.
make compile_model
Uses the network description and the trained weights files to generate an IR (intermediate representation) format file. This file is later loaded on the Neural Compute Stick where the inferences on the network can be executed.
make install-reqs
Checks required packages that aren’t installed as part of the OpenVINO installation.
make uninstall-reqs
Uninstalls requirements that were installed by the sample program.
make clean
Removes all the temporary and target files that are created by the Makefile.
Troubleshooting
Makefile:31: *** TF_MODELS_PATH is not defined. Run `export TF_MODELS_PATH=path/to/your/tensorflow/models/repo`. Stop.
- Make sure TF_MODELS_PATH is pointing to your tensorflow models directory.
Makefile:46: *** TF_SRC_PATH is not defined. Run `export TF_SRC_PATH=path/to/your/tensorflow/source/repo`. Stop.
- Make sure TF_SRC_PATH is pointing to your tensorflow source directory.