- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Are pyinstaller and openvino incompatible?
If you run the following code directly on Windows 10 with "w_openvino_toolkit_p_2020.1.033" installed
start
end
is displayed.
----------------------------------------------
import numpy as np
from openvino.inference_engine import IENetwork, IECore
print("start")
e = IECore()
print("end")
----------------------------------------------
But when I run the exe'd file with pyinstaller.
start
only
Is there something to be set up?
Thank you very much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried converting your python sample to .exe and I was able to see both Start and End on running the .exe
For that I used the following command to create .exe. We need to give dependency files for iecore() to work. Here plugins.xml helps the sample to load the required plugins. In our case its MKLDNNPlugin for CPU.
pyinstaller --onefile --add-data "C:\Program Files (x86)\IntelSWTools\openvino_2020.3.194\deployment_tools\inference_engine\bin\intel64\Release\plugins.xml;." demo_sample.py
Here is the output..
Regards,
Srujana
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Shigeo,
There should not be an incompatibility with pyinstaller and openvino. Can you please provide the error you are getting?
Just a note: OpenVINO 2020.2 has also been released! I would recommend installing the latest version and trying again.
Best Regards,
Sahira
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sahira.
Unfortunately, it's over without a message.
The following is the content displayed.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\Develop\Python\dlibtest>C:/Python36/python.exe d:/Develop/Python/dlibtest/test.py
start
end
D:\Develop\Python\dlibtest>dist\test.exe
start
D:\Develop\Python\dlibtest>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I tried openvino2020.2. but It was the same.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sahira.
It's been a while.
I tried openvino2020.3, then I get an error message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\Develop\Python\dlibtest>C:/Python36/python.exe d:/Develop/Python/dlibtest/test.py
start
end
D:\Develop\Python\dlibtest>dist\test.exe
Traceback (most recent call last):
File "site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py", line 11, in <module>
File "c:\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\pkg_resources\__init__.py", line 86, in <module>
ModuleNotFoundError: No module named 'pkg_resources.py2_warn'
[11808] Failed to execute script pyi_rth_pkgres
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Does this give you a clue as to how to solve the problem?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was able to fix the same issue by upgrading the setup tools.
pip3 install --upgrade 'setuptools<45.0.0'
Hope it helps!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
Thank you for your reply.
When I replaced the setuptools with the old ones as you mentioned, the error disappeared completely.
Thank you for the tip on what to do when pyinstaller doesn't work.
However, the "end" doesn't show up when I run the exe.
This is the same as below.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\Develop\Python\dlibtest>C:/Python36/python.exe d:/Develop/Python/dlibtest/test.py
start
end
D:\Develop\Python\dlibtest>dist\test.exe
start
D:\Develop\Python\dlibtest>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried converting your python sample to .exe and I was able to see both Start and End on running the .exe
For that I used the following command to create .exe. We need to give dependency files for iecore() to work. Here plugins.xml helps the sample to load the required plugins. In our case its MKLDNNPlugin for CPU.
pyinstaller --onefile --add-data "C:\Program Files (x86)\IntelSWTools\openvino_2020.3.194\deployment_tools\inference_engine\bin\intel64\Release\plugins.xml;." demo_sample.py
Here is the output..
Regards,
Srujana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To deep dive also go through the below solution.
Regards,
Srujana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried it and it worked fine.
Excellent!
Thank you for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, @Srujana
I followed your suggestion and added plugins.xml to my pyinstaller cmd argument,
It can produce .exe file, however when I execute it, I got following error,
how can I fix it?
(my pip install openvino version is 2021.4.2
and execute following command on terminal to produce the exe file:
pyinstaller --noconfirm --onedir --windowed --icon "C:/Users/USER/Desktop/lab5/media/ultrasound_icon.ico" --debug "all" --add-data "C:/Users/USER/Desktop/lab5/media;media/" --add-data "C:/Users/USER/Desktop/AIGO/lab5/model_IR;model_IR/" --add-data "C:/Program Files (x86)/Intel/openvino_2021.4.752/inference_engine/bin/intel64/Release/plugins.xml;." "C:/Users/USER/Desktop/lab5/UI.py"
in the "lab5" folder, file structure as below:
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page