POT_tutorial icon indicating copy to clipboard operation
POT_tutorial copied to clipboard

OpenVINO Post-Training Optimization Toolkit Tutorial

OpenVINO Post-Training Optimization Toolkit (POT) Tutorial

Post-Training Optimization Toolkit (POT) is a part of OpenVINO Toolkit which is responsible of applying different optimization techniques like quantization or sparsity. This repo helps you to easy undestand the tool in well-documented practical way.

This tutorial consists of 2 parts:

BASIC which shows "standard" quantization workflow

  • What's POT configuration files structure
  • How to run POT in simplified mode
  • How to measure accuracy of FP32, INT8 models using POT config
  • How to create your own POT config
  • How to properly benchmark the workload

ADVANCED covers complicated cases and focuses on custom functionality, discovering secrets of Accuracy Checker - the base of POT.

  • Accuracy checker architecture
  • How to analyze the model
  • How to support custom dataset
  • How to add custom pre- and post- processing
  • YoloV3 example
  • DCSCN example

Prerequisites:

  1. Installed Intel(R) Distrubution of OpenVINO Toolkit 2020.2 for Linux.
  2. Installed OpenVINO Accuracy Checker Tool with all dependencies.
  3. Installed OpenVINO Post-Training Optimization Toolkit with all dependencies.

Note: the tutorial was created for Ubuntu OS but can also be adapted for other supported OSes.

Note: the tutorial was checked for OpenVINO 2020.2 and might be not working with other versions.

Getting Started:

You can run the tutorial at your own machine:

  1. Clone or download the repo:

$ git clone https://github.com/avbelova/POT_tutorial.git

  1. Go to the tutorial directory:

$ cd POT_tutorial

  1. Set up OprnVINO environment:

$ source /opt/intel/openvino/bin/setupvars.sh

  1. Run Jupyter Notebook

$ jupyter notebook

or Jupyter lab

$ jupyter lab

The other option is to run it on the Intel® DevCloud for the Edge. In this case you don't need to install anything and source environment variables. You should just clone the repo, proceed to the directory and run Jupyter notebook/lab.

As an addition, you can also watch how to perform model quantization with POT via Deep Learning Workbench.