Starting with the 2020.1 version, OpenVINO™ toolkit delivers the Post-Training Optimization Tool designed to accelerate the inference of DL models by converting them into a more hardware-friendly representation by applying specific methods that do not require re-training, for example, post-training quantization. For more details about the low-precision flow in OpenVINO™, refer to the Low Precision Optimization Guide.
Post-Training Optimization Toolkit includes standalone command-line tool and Python* API that provide the following key features:
The toolkit is distributed as a part of the OpenVINO release package and available after installation from the <INSTALL_DIR>/deployment_tools/tools/post_training_optimization_toolkit
. It's recommended to create a separate Python* environment before installing the OpenVINO components. To install the toolkit into your environment, follow the steps below:
<INSTALL_DIR>/deployment_tools/open_model_zoo/tools/accuracy_checker
.setup.py
script: <INSTALL_DIR>/deployment_tools/tools/post_training_optimization_toolkit
.setup.py
script: Now the toolkit is available in the command line by the pot
alias.
The toolkit works with pre-trained models in the OpenVINO Intermediate Representation (IR) format, which means that you need to convert the model using Model Optimizer before running the optimization tool. In addition, it's highly recommended to make sure that the model can be successfully inferred and achieves the similar accuracy numbers as the reference model from the original framework. In order to do this, the AccuracyChecker tool can be used.
To run the command-line Post-Training Optimization Tool:
configs
folder. To simplify this step, an AccuracyChecker configuration file for the full-precision model can be used and referred.-h
, --help
arguments or refer to the Command-Line Arguments below.results
folder that is created in the same directory where the tool is run from. Use the -e
option to evaluate the accuracy directly from the tool.The following command-line options are available to run the tool:
Argument | Description |
---|---|
-h , --help | Optional. Show help message and exit. |
-c CONFIG , --config CONFIG | Path to a config file with task/model-specific parameters. |
-e , --evaluate | Optional. Evaluate model on the whole dataset after optimization. |
--output-dir OUTPUT_DIR | Optional. A directory where results are saved. Default: ./results . |
-sm , --save-model | Optional. Save the original (FP32) model. |
-d , --direct-dump | Optional. Save results directly to output directory without additional subfolders. |
--log-level {CRITICAL,ERROR,WARNING,INFO,DEBUG} | Optional. Log level to print. INFO is by default. |