How to use pyinstaller packaging to a exe with openvino.
there is the error:
Traceback (most recent call last):
File "test.py", line 12, in <module>
File "c:\users\niuwj\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
File "openvino\inference_engine\__init__.py", line 1, in <module>
File "ie_api.pyx", line 24, in init openvino.inference_engine.ie_api
ModuleNotFoundError: No module named 'openvino.inference_engine.constants'
 Failed to execute script test
there is the script:
import logging as log
from openvino.inference_engine import IECore, IENetwork
ie = IECore()
model_bin = "result_yolov4_fp16/frozen_darknet_yolov4_model.bin"
model_xml = "result_yolov4_fp16/frozen_darknet_yolov4_model.xml"
net = ie.read_network(model=model_xml, weights=model_bin)
log.info("Device info: CPU")
log.info("Loading model to the device")
print("Loading model to the device")
exec_net = ie.load_network(network=net, device_name=device)
and i can successfully run it by python test.py
Loading model to the device
<openvino.inference_engine.ie_api.ExecutableNetwork object at 0x000002239AD439A0>
there is the command
pyinstaller -F --add-data "C:\Program Files (x86)\IntelSWTools\openvino_2020.4.287\deployment_tools\inference_engine\bin\intel64\Release\plugins.xml;." test.py
Hi Niu Wenju,
Pyinstaller is not officially supported by OpenVINO, but we offer other options for similar deployment scenario: OpenVINO Deployment Manager, Conda installer, APT, and YUM.
I would suggest you try any one of those.
Regardless the fact that OpenVINO toolkit does not officially support Pyinstaller, it might work on OpenVINO 2020.3 release.
We have reproduced the same error message that you see on 2020.4, however, please have a chance to try your model on 2020.3 (both plugins.xml and env variables setupvars.bat should be from 2020.3 package). We tested this with face-detection-retail-0005 and that worked.
You might also need to downgrade setuptools version with:
pip install --upgrade 'setuptools<45.0.0'
Hope this helps.
Hi Niu Wenju,
This thread will no longer be monitored since we have provided a workaround. If you need any additional information from Intel, please submit a new question.