Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
171 Views

Are pyinstaller and openvino incompatible?

Jump to solution

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.

0 Kudos

Accepted Solutions
Highlighted
Employee
122 Views

Re: Thank you for your reply.

Jump to solution

Hi @Imura__Shigeo 

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

Srujana_0-1593429803734.png

Regards,

Srujana 

View solution in original post

0 Kudos
8 Replies
Highlighted
Moderator
171 Views

Hi Shigeo,

Jump to solution

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 

0 Kudos
Highlighted
Beginner
171 Views

Hi Sahira.

Jump to solution

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.

 

 

 

0 Kudos
Highlighted
Beginner
171 Views

Hi Sahira.

Jump to solution

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.

 

 

0 Kudos
Highlighted
Employee
168 Views

Re: Hi Sahira.

Jump to solution

Hi  @Imura__Shigeo 

I was able to fix the same issue by upgrading the setup tools.

pip3 install --upgrade 'setuptools<45.0.0'

Hope it helps!!

 

0 Kudos
Highlighted
Beginner
150 Views

Thank you for your reply.

Jump to solution

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.

0 Kudos
Highlighted
Employee
123 Views

Re: Thank you for your reply.

Jump to solution

Hi @Imura__Shigeo 

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

Srujana_0-1593429803734.png

Regards,

Srujana 

View solution in original post

0 Kudos
Highlighted
Employee
116 Views

Re: Thank you for your reply.

Jump to solution

@Imura__Shigeo 

 

To deep dive also go through the below solution.

https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exe-built-using-OpenVino-and-pyinstall...

 

Regards,

Srujana

 

0 Kudos
Highlighted
Beginner
99 Views

Re: Thank you for your reply.

Jump to solution

I tried it and it worked fine.

Excellent!


Thank you for your help.

0 Kudos