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.
6405 Discussions

Error when trying to run the Model Quantization to INT8

DarkHorse
Employee
487 Views

Hello,

 

I am following this documentation and I run into this error messages when I tried to execute:

 

pot -c mobilenet_v2_pytorch_int8.json -e

 

OS: Windows 11

Python: 3.8.2

OpenVINO_2023

 

(openvino_env) F:\openvino_env\Scripts>pot.exe -c "F:\openvino_env\Scripts\accuracy\mobilenet_v2_pytorch_int8.json" -e --output-dir "F:\IR_Models\int8"
f:\openvino_env\lib\site-packages\openvino\offline_transformations\__init__.py:10: FutureWarning: The module is private and following namespace `offline_transformations` will be removed in the future.
warnings.warn(
[ DEBUG ] Creating converter from 7 to 5
[ DEBUG ] Creating converter from 5 to 7
[ DEBUG ] Creating converter from 7 to 5
[ DEBUG ] Creating converter from 5 to 7
Post-training Optimization Tool is deprecated and will be removed in the future. Please use Neural Network Compression Framework instead: https://github.com/openvinotoolkit/nncf 
Nevergrad package could not be imported. If you are planning to use any hyperparameter optimization algo, consider installing it using pip. This implies advanced usage of the tool. Note that nevergrad is compatible only with Python 3.7+
Post-training Optimization Tool is deprecated and will be removed in the future. Please use Neural Network Compression Framework instead: https://github.com/openvinotoolkit/nncf 
Traceback (most recent call last):
File "C:\Users\allensen\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\allensen\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "F:\openvino_env\Scripts\pot.exe\__main__.py", line 7, in <module>
File "f:\openvino_env\lib\site-packages\openvino\tools\pot\app\run.py", line 26, in main
app(sys.argv[1:])
File "f:\openvino_env\lib\site-packages\openvino\tools\pot\app\run.py", line 40, in app
config = Config.read_config(args.config)
File "f:\openvino_env\lib\site-packages\openvino\tools\pot\configs\config.py", line 36, in read_config
data = cls._read_config_from_file(path)
File "f:\openvino_env\lib\site-packages\openvino\tools\pot\configs\config.py", line 32, in _read_config_from_file
return read_config_from_file(path)
File "f:\openvino_env\lib\site-packages\openvino\tools\pot\utils\config_reader.py", line 19, in read_config_from_file
return json.load(f)
File "f:\openvino_env\lib\site-packages\jstyleson.py", line 127, in load
return loads(fp.read(), **kwargs)
File "f:\openvino_env\lib\site-packages\jstyleson.py", line 123, in loads
return json.loads(dispose(text), **kwargs)
File "C:\Users\allensen\AppData\Local\Programs\Python\Python38\lib\json\__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "C:\Users\allensen\AppData\Local\Programs\Python\Python38\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\allensen\AppData\Local\Programs\Python\Python38\lib\json\decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 4 column 21 (char 83)

 

 

Can someone help?

 

Labels (1)
0 Kudos
1 Solution
DarkHorse
Employee
462 Views

Hi,


This issue has been resolved. Eventually, there is something wrong with the json file.

 

After I declare the path of the .xml and .bin files, this has been resolved.

 

Before:

 

"model": "F:\IR_Models\public\mobilenet-v2-pytorch\FP32\mobilenet-v2-pytorch.xml",
"weights": "F:\IR_Models\public\mobilenet-v2-pytorch\FP32\mobilenet-v2-pytorch.bin"
},
"engine": {
"config": "F:\openvino_env\Scripts\accuracy\mobilenet_v2_pytorch.yaml"

 

After: 

 

"model": "F:\\IR_Models\\public\\mobilenet-v2-pytorch\\FP32\\mobilenet-v2-pytorch.xml",
"weights": "F:\\IR_Models\\public\\mobilenet-v2-pytorch\\FP32\\mobilenet-v2-pytorch.bin"
},
"engine": {
"config": "F:\\openvino_env\\Scripts\\accuracy\\mobilenet_v2_pytorch.yaml"

 

Thanks.

View solution in original post

0 Kudos
2 Replies
DarkHorse
Employee
463 Views

Hi,


This issue has been resolved. Eventually, there is something wrong with the json file.

 

After I declare the path of the .xml and .bin files, this has been resolved.

 

Before:

 

"model": "F:\IR_Models\public\mobilenet-v2-pytorch\FP32\mobilenet-v2-pytorch.xml",
"weights": "F:\IR_Models\public\mobilenet-v2-pytorch\FP32\mobilenet-v2-pytorch.bin"
},
"engine": {
"config": "F:\openvino_env\Scripts\accuracy\mobilenet_v2_pytorch.yaml"

 

After: 

 

"model": "F:\\IR_Models\\public\\mobilenet-v2-pytorch\\FP32\\mobilenet-v2-pytorch.xml",
"weights": "F:\\IR_Models\\public\\mobilenet-v2-pytorch\\FP32\\mobilenet-v2-pytorch.bin"
},
"engine": {
"config": "F:\\openvino_env\\Scripts\\accuracy\\mobilenet_v2_pytorch.yaml"

 

Thanks.

0 Kudos
Megat_Intel
Moderator
441 Views

Hi DarkHorse,

Thank you for reaching out to us.

 

This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question.

 

 

Regards,

Megat


0 Kudos
Reply