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 transfer an openvino application into exe

GangXiong
Novice
1,255 Views

Openvino version: 2020.4.287

device: GPU

In my application, everything goes fine when I ran the program via python. But when I packaged my application into exe via pyinstaller, the following errors occurred:

Traceback (most recent call last):
  File "main.py", line 8, in <module>
    from DeepLearningDetection import DeepLearingDetection
  File "d:\python3.6.5\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
    exec(bytecode, module.__dict__)
  File "DeepLearningDetection.py", line 5, in <module>
    from openvino.inference_engine import IECore
  File "d:\python3.6.5\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'
[6816] Failed to execute script main

 To tack the problem , I used the following test.py :

from openvino.inference_engine import IECore

def load():
    ie = IECore()
    model_bin = "E:\\Tire defect detection\\TrainFasterRCNNResnet50_V2\\OpenvinoModel\\frozen_inference_graph.bin"
    model_xml = "E:\\Tire defect detection\\TrainFasterRCNNResnet50_V2\\OpenvinoModel\\frozen_inference_graph.xml"
    net = ie.read_network(model=model_xml, weights=model_bin)
    print("Device info: CPU")
    device="CPU"
    print("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 then:

pyinstaller -F --add-data "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\inference_engine\bin\intel64\Release\plugins.xml;." test.py

 

The error became the following when I ran the exe file:

Traceback (most recent call last):
  File "TestOpenvino.py", line 2, in <module>
    from openvino.inference_engine import IECore
  File "d:\python3.6.5\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 16, in init openvino.inference_engine.ie_api
ModuleNotFoundError: No module named 'pathlib'
[3432] Failed to execute script TestOpenvino

 I'm sure that I have installed the 'pathlib' package. I don't know why. Are there any instructions on how to transfer an openvino application into exe via pyinstaller?

0 Kudos
1 Solution
IntelSupport
Moderator
1,222 Views

Hi GangXiong,

 

Thanks for reaching out.

Unfortunately, Pyinstaller is not officially supported by the OpenVINO toolkit.

I would suggest you try other deployment scenarios: OpenVINO Deployment Manager, Conda installer, APT, and YUM.


Another workaround, you can try your model on OpenVINO 2020.3 release with both plugins.xml and environment variable setupvars.bat from the 2020.3 packages. We tested this with face-detection-retail-0005 and that worked.

 

You need to downgrade the setup tools version with: pip install --upgrade 'setuptools<45.0.0'

 

Regards,

Aznie


View solution in original post

0 Kudos
3 Replies
Munesh_Intel
Moderator
1,229 Views

 

Hi Gang Xiong,

 

Since you have posted the same question in another thread, I will proceed to close the thread 1212828.

https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/How-to-package-openvio-into-exe/m-p/1212828

 

Further communication/queries are to be posted in this thread (Thread 1212839) only.

https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/How-to-transfer-an-openvino-application-into-exe/m-p/1212839

 

Regards,

Munesh

0 Kudos
IntelSupport
Moderator
1,223 Views

Hi GangXiong,

 

Thanks for reaching out.

Unfortunately, Pyinstaller is not officially supported by the OpenVINO toolkit.

I would suggest you try other deployment scenarios: OpenVINO Deployment Manager, Conda installer, APT, and YUM.


Another workaround, you can try your model on OpenVINO 2020.3 release with both plugins.xml and environment variable setupvars.bat from the 2020.3 packages. We tested this with face-detection-retail-0005 and that worked.

 

You need to downgrade the setup tools version with: pip install --upgrade 'setuptools<45.0.0'

 

Regards,

Aznie


0 Kudos
IntelSupport
Moderator
1,188 Views

Hi GangXiong,


This thread will no longer be monitored since we have provided a solution. If you need any additional information from Intel, please submit a new question.


Regards,

Aznie


0 Kudos
Reply