Openvino quantization issue: Error in loading quantized int8 model, Runtime error: Quantize layer only supports per tensor and per channel quantization
Hi
I tried to quantize a face detection model RFB (receoptive field block) from FP 32 to int8 using openvino's POT . I added a new class for this detector in detection.py under accuracy_checker/adapters. I was able to convert to int8 but I get this runtime error: Runtime error: Quantize layer 466/fq_input_0 only supports per tensor and per channel quantization. I am not sure what is the problem. I have attached the quantized models and the error log. If someone can help me then it will be much appreciated. rfb_quantization.zip
@baishalichaudhury what version of OpenVINO you used? As I understand the model is not from OMZ, is it right?
@vladimir-dudnik Hi I am using openvino_2021.1.110. No th emodel is not from model zoo. Its from here: https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/tree/master/models/onnx. I have also attached the FP32 IR model which I have been using successfuly RFB_FP32.zip
@baishalichaudhury I would recommend you to try the latest OpenVINO release, 2021.3, there were many changes and improvements in POT tools since 2021.1 release, so it might happens that issue was solved already.
cc @MaximProshin
@vladimir-dudnik Ok let me try that.
Hi
I installed the latest openvino on windows 10, and I wastrying to install accuracy checker (I installed mo without problem) I get the following error: Extracting accuracy_checker-0.8.6-py3.8.egg to c:\users\baishali\appdata\local\programs\python\python38\lib\site-packages accuracy-checker 0.8.6 is already the active version in easy-install.pth Installing accuracy_check-script.py script to C:\Users\baishali\AppData\Local\Programs\Python\Python38\Scripts Installing accuracy_check.exe script to C:\Users\baishali\AppData\Local\Programs\Python\Python38\Scripts Installing convert_annotation-script.py script to C:\Users\baishali\AppData\Local\Programs\Python\Python38\Scripts Installing convert_annotation.exe script to C:\Users\baishali\AppData\Local\Programs\Python\Python38\Scripts
Installed c:\users\baishali\appdata\local\programs\python\python38\lib\site-packages\accuracy_checker-0.8.6-py3.8.egg Processing dependencies for accuracy-checker==0.8.6 Searching for shapely Reading https://pypi.org/simple/shapely/ Downloading https://files.pythonhosted.org/packages/de/30/e0492acfbb8d5ddd077dff5e5a3f9f85be420d17950b9941cdc2519bd7f0/Shapely-1.8a1.tar.gz#sha256=a748ab74c187060264e7ce838aaac30eead2a791bbea8cc3ab1dfc3cc0b4d067 Best match: Shapely 1.8a1 Processing Shapely-1.8a1.tar.gz Writing C:\Users\baishali\AppData\Local\Temp\easy_install-zfhn3jtn\Shapely-1.8a1\setup.cfg Running Shapely-1.8a1\setup.py -q bdist_egg --dist-dir C:\Users\baishali\AppData\Local\Temp\easy_install-zfhn3jtn\Shapely-1.8a1\egg-dist-tmp-wnkfnrst error: Could not find module 'geos_c.dll' (or one of its dependencies). Try using the full path with constructor syntax.
C:\Program Files (x86)\Intel\openvino_2021\deployment_tools\open_model_zoo\tools\accuracy_checker>
On Wed, May 19, 2021 at 10:02 AM Vladimir Dudnik @.***> wrote:
@baishalichaudhury https://github.com/baishalichaudhury I would recommend you to try the latest OpenVINO release, 2021.3, there were many changes and improvements in POT tools since 2021.1 release, so it might happens that issue was solved already.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openvinotoolkit/open_model_zoo/issues/2413#issuecomment-844295042, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC764U3RVEGJ32G4ALCNTX3TOPVLLANCNFSM45E4XBHA .
@eaidova could you please help to resolve this? In my python 3.7 environment (created some time ago) shapely is 1.7.1 version and it works.
@baishalichaudhury it looks like issue of setuptools, which uses some different source of shapely lib, where wheel for windows and this python version is not available (building it from source required some specific dependencies). Could you please try install shaply using pip (pip install Shapely) , then repeat installation accuracy_checker
I had tried with pip install but it still gave the same error
On Wed, May 19, 2021 at 7:14 PM Ekaterina Aidova @.***> wrote:
@baishalichaudhury https://github.com/baishalichaudhury it looks like issue of setuptools, which uses some different source of shapely lib, where wheel for windows and this python version is not available (building it from source required some specific dependencies). Could you please try install shaply using pip (pip install Shapely) , then repeat installation accuracy_checker
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openvinotoolkit/open_model_zoo/issues/2413#issuecomment-844629400, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC764U4A54RJPGFLFFAX5N3TORV75ANCNFSM45E4XBHA .
@baishalichaudhury
then could you please try to run:
pip install Shapely==1.7.1
or if it still does not work, please try to upgrade pip
I did upgrade pip like this python -m pip install --upgrade pip
and also tried installing Shapely 1.7.1 , but I am still getting the exact same error
On Thu, May 20, 2021 at 4:56 AM Ekaterina Aidova @.***> wrote:
@baishalichaudhury https://github.com/baishalichaudhury
then could you please try to run:
pip install Shapely==1.7.1
or if it still does not work, please try to upgrade pip
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openvinotoolkit/open_model_zoo/issues/2413#issuecomment-845028596, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC764UZJ4UVCIJ7KEI2CX4DTOT2HBANCNFSM45E4XBHA .
@baishalichaudhury it sounds sad... Then I may suggest workaround. This lib is not required for your model quantization, so you can just remove it from Accuracy Checker dependencies list without any pain. You can find requirements.in in accuracy checker directory inside package (it looks like https://github.com/openvinotoolkit/open_model_zoo/blob/master/tools/accuracy_checker/requirements.in#L14) and just comment line with shapely
Hi
Thanks , the workaround worked fine and I was able to install accuracy checker. But when I tried to install POT I get the following error error: Setup script exited with error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe' failed with exit status 2
Any idea
On Thu, May 20, 2021 at 8:02 AM Ekaterina Aidova @.***> wrote:
@baishalichaudhury https://github.com/baishalichaudhury it sounds sad... Then I may suggest workaround. This lib is not required for your model quantization, so you can just remove it from Accuracy Checker dependencies list without any pain. You can find requirements.in in accuracy checker directory inside package (it looks like https://github.com/openvinotoolkit/open_model_zoo/blob/master/tools/accuracy_checker/requirements.in#L14 ) and just comment line with shapely
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openvinotoolkit/open_model_zoo/issues/2413#issuecomment-845200409, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC764U2DX55UFZ4XRXWBX6LTOUQBRANCNFSM45E4XBHA .
@MaximProshin could you please comment on POT installation issue (Windows)
Hi @baishalichaudhury,
It seems like you have compilation problems when building one of the POT dependencies from scratch. Could you also please provide the stack trace for us to identify which dependency package could not be installed and we could propose a workaround?
Hi
I tried it in Linux machine instead of Windows and that worked fine. I was also able to quantize the model without any errors with the latest openvino2021.3. I will have to check the map with the quantized model but thats not related to this issue. Thanks for all the help.
On Mon, May 24, 2021 at 5:30 AM Ivan Lazarevich @.***> wrote:
Hi @baishalichaudhury https://github.com/baishalichaudhury,
It seems like you have compilation problems when building one of the POT dependencies from scratch. Could you also please provide the stack trace for us to identify which dependency package could not be installed and we could propose a workaround?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openvinotoolkit/open_model_zoo/issues/2413#issuecomment-847009921, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC764U6GBGMA3BCN3ER6Q6TTPJBEVANCNFSM45E4XBHA .