Community
cancel
Showing results for 
Search instead for 
Did you mean: 
niuwj
Beginner
527 Views

How to use pyinstaller packaging to a exe

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
525 Views

Munesh_Intel
Moderator
501 Views

Hi Niu Wenju,


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


Regards,

Munesh


Munesh_Intel
Moderator
486 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


Max_L_Intel
Moderator
461 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.

Munesh_Intel
Moderator
407 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


GangXiong
Novice
365 Views

Hi Niuwj,

 

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

Reply