Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6434 Discussions

How to get INT8 precision of ResNet50 of OpenVINO2021.1

guanglil
Employee
1,311 Views

HI all,

How can i get a model of ResNet-50 with INT8 precision of OpenVINO2021.1?

0 Kudos
1 Solution
Vladimir_Dudnik
Employee
1,300 Views

Hello,

it is possible to quantize model with using Post Optimization Toolkit and in Open Model Zoo we provide for convenience the script, which simplify the task (it will call POT with appropriate parameters) and quantize model, see Model Quantizer Usage section of Open Model Zoo documentation.

Note, as a prerequisite for quantization you may need to download suitable dataset.

Regards,
  Vladimir

View solution in original post

5 Replies
Vladimir_Dudnik
Employee
1,301 Views

Hello,

it is possible to quantize model with using Post Optimization Toolkit and in Open Model Zoo we provide for convenience the script, which simplify the task (it will call POT with appropriate parameters) and quantize model, see Model Quantizer Usage section of Open Model Zoo documentation.

Note, as a prerequisite for quantization you may need to download suitable dataset.

Regards,
  Vladimir

guanglil
Employee
1,286 Views

Hi Vladimir,

Thanks for your info. I use this method to transfer ResNet50 to INT8 and FP32 successfully.

And I run benchmark_app with ResNet50 FP32 and INT8 precision. But I got different results in FP32 between model gets from https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/1/resnet50-binary-0001/ and transfer by myself. for example, in batch_size=8, using my transferred model, it only got 38.66fps while using downloading from 01.org, i can get 173.37fps.

So, could you please give me a hint why got so different result?

 

Guangli

0 Kudos
Vladimir_Dudnik
Employee
1,267 Views

As you may see from model description, resnet50-binary-0001 is FP32-INT1 model

This is a classical classification network for 1000 classes trained on ImageNet. The difference is that most convolutional layers were replaced by binary once that can be implemented as XNOR+POPCOUN operations. Only input, final and shortcut layers were kept as FP32, all the rest convolutional layers are replaced by BinaryConvolution layers.

 

 and so, it is different from FP32-INT8 model you get through quantization with POT tool

Vladimir

0 Kudos
Munesh_Intel
Moderator
1,274 Views

Hi Guangli,


We would like to confirm your question here. You are comparing two FP32 models here (your ‘transferred’ ResNet50 FP32 model against resnet50-binary-0001 FP32 model downloaded from 01.org), aren’t you?


If that’s the case, please share more information about your model, such as the layers in use, command given to Model Optimizer to convert the trained model to Intermediate Representation (IR), and environment details (versions of OS, Python, CMake, TensorFlow, etc.).


Regards,

Munesh



0 Kudos
Munesh_Intel
Moderator
1,229 Views

Hi Guangli,

 

This thread will no longer be monitored since we have provided solution and explanation. If you need any additional information from Intel, please submit a new question.

 

Regards,

Munesh

 

0 Kudos
Reply