The toolkit provides capabilities to use optimization algorithms through an API. It means that the user embeds the optimization code into its own inference pipeline, which is usually a model validation script for a full-precision model. Here we describe a sample of how to do this embedding on the ImageNet classification task.
In order to use optimization features one should implement the following interfaces which are required for the optimization process:
engines
folder in the compression
directory.sample
folder.AccuracyAwareQuantization
algorithm and implements an accuracy metric calculation. An example of the Accuracy Top-1 metric can be found in the sample
folder.The sample demonstrates quantization of the classification model using API implementation described above. The sample is designed for solving classification task on the ImageNet dataset and works only for models with TensorFlow* contrib preprocessing. Sample implementation is available in the sample
folder.
In the instructions below, the Post-Training Optimization Tool directory <INSTALL_DIR>/deployment_tools/tools/post_training_optimization_toolkit
is referred to as <POT_DIR>
. <INSTALL_DIR>
is the directory where Intel® Distribution of OpenVINO™ toolkit is installed.
downloader
tool to download a model with TensorFlow* preprocessing from the Open Model Zoo repository. The sample was tested with with the mobilenet-v2-1.0-224
model. converter
tool to generate the IRv10 model: sample
folder and launch the sample script: -w
, --weights
options.WARNING: Sample works with predefined central crop and resize. In other words, it suits only for models with TensorFlow* preproc.