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

How to use pyinstaller packaging to a exe

niuwj
Beginner
1,301 Views

openvino version:2020.4.287

device:MYRIAD、 HDDL

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
exec(bytecode, module.__dict__)
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'
[2536] Failed to execute script test

 

there is the script:

import numpy
import logging as log
from openvino.inference_engine import IECore, IENetwork

def load():
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")
device="MYRIAD"
log.info("Loading model to the device")
print("Loading model to the device")
exec_net = ie.load_network(network=net, device_name=device)
print(exec_net)
print("model loaded")

load()

 

and i can successfully run it by python test.py

Loading model to the device
<openvino.inference_engine.ie_api.ExecutableNetwork object at 0x000002239AD439A0>
model loaded

 

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

0 Kudos
6 Replies
niuwj
Beginner
1,300 Views
0 Kudos
Munesh_Intel
Moderator
1,276 Views

Hi Niu Wenju,


We are currently investigating this issue, and will get back to you.


Regards,

Munesh


0 Kudos
Munesh_Intel
Moderator
1,261 Views

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.


Regards,

Munesh


0 Kudos
Max_L_Intel
Moderator
1,236 Views

Hi @niuwj 

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.

0 Kudos
Munesh_Intel
Moderator
1,182 Views

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.


Regards,

Munesh


0 Kudos
GangXiong
Novice
1,140 Views

Hi Niuwj,

 

I met the same problem. Have you found any solutions to this problem?

0 Kudos
Reply