I'm trying to use OpenVINO and NCS2 in my Raspberry Pi4 machine.
I successfully built the OpenVINO for Python3.7 environment as following:
However, when I tried to import openvino.inference in Python, I faced the "Segmentation fault (core dumped)" and crash Python in my console.
Actually, when I import openvino only, I didn't face crash, but the case of "openvino.inference_engine" is crashing my Python ("from openvino import inference_engine" is also crashing).
How can I do that?
My environment as below.
Machine: Raspberry Pi4 8GB
OS: Ubuntu18.04 and Ubuntu Mate
Python: Python3.7.4 (virtualenv)
Thank you in advance.
There is an OpenVINO distribution for the Raspberry Pi with NCS2 but it is for Raspberry Pi OS.
Is there a need for you to use Ubuntu as the OS?
If not I would recommend you to use Raspberry Pi OS/Raspbian.
I have managed to compile and load openvino.inference_engine in python without throwing segmentation fault.
However my environment is a little bit different.
I ran it on
Machine: Pi 4 (4GB RAM)
OS : Ubuntu Desktop 20.10 for ARM .
Python : 3.7.9 (I had some trouble using apt-get so I compiled from source. I did NOT run this in virtual env).
Thank you for replying, actually I have the restriction of using Ubuntu 18.04 OS in my project.
I'm still struggling to build OpenVINO library for python.
I tried to use other branch like 2020.3 and 2020.4, however it give me another error, then I cannot reach to built python library...
I didn't try out of virtualenv, so I will try to build in original environment.
Could you help share the website or download link to the exact image of the OS you are using?
The current Ubuntu distribution I found for ARM are mostly Ubuntu version 20.
And also my make option is as following:
sudo cmake -DCMAKE_BUILD_TYPE=Release \
I am able to avoid the segmentation error by using the following arguments when building the Python wrappers for the OpenVINO.
-DPYTHON_EXECUTABLE=`which python3.x` \
-DPYTHON_LIBRARY=<path to downloaded python source>/Lib \
-DPYTHON_INCLUDE_DIR=<path to downloaded python source>/Include \
I needed to copy pyconfig.h inside the source into the Include folder in order for it to work.
I followed some instruction similar to this guide for compiling Python.
I have tested importing and initiating IECore class without error, but have yet to test the full functionality.
Could you try compiling using the arguments mentioned to see if it works on your machine?
Yes I am using Ubuntu Server20.4 and I cloned OpenVINO from the master branch of the repository. I used Python 3.7.9 but I think you can use any version (not tested) as you will compile the pyd from source.
Additionally, I found where Ubuntu place its downloads for previous version Ubuntu for ARM.
Thank you for supporting. I followed your description, however I still got segmentation fault.
Actually, I was able to build OpenVINO (nothing error when cmake/make/make install command).
I used "gdb" command to see error in detail (I've heard gdb help us when we faced segmentation error). Then it shows:
ubuntu@ubuntu:~$ gdb python3.7
Starting program: /usr/local/bin/python3.7
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
Python 3.7.4 (default, Oct 19 2020, 03:15:56)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from openvino.inference_engine import IECore
Program received signal SIGSEGV, Segmentation fault.
0x0000fffff74a3714 in ?? ()
#0 0x0000fffff74a3714 in ?? ()
#1 0x0000fffff771b900 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
It's not help me...
I am sorry but I may be wrong in my compilation method.
I have received a feedback from my colleagues and they concluded that the configuration is not officially supported.
They have tested it from their side and confirmed it is not supported.
I would have to recommend installing Raspbian OS on your Raspberry Pi for OpenVINO usage.
Thankyou for exploring this deployment possibility and
I am sorry it has taken this long.
Is there anything else I can help with?
No, it's okay. I really appreciate your supporting long time.
I will discuss with my colleague to find another way.
Actually, there is only Raspbian OS 32bit version, then it cannot use fully 8GB memory model of Raspberry pi. And also there are some problem in ROS usage.
I hope OpenVINO Ubuntu version will be released in future.
Thank you for your kindness and hospitality.
Yes, I was able to load the openvino.inference engine on Ubuntu 20.04.
I build in <openvino source>/build/,
then I found the python wrappers in <openvino source>/bin/aarch64/Release/lib/python_api/python3.x/
Then I added that path to the PYTHONPATH.
Intel will no longer monitor this thread since we have provided a solution. If you need any additional information from Intel, please submit a new question.
On a final note, I compiled it on Pi4 with 4GB RAM (just in case there is a difference between the 4GB and 8GB RAM versions).
I hope you will be able to find a solution to your project needs.
I wish you all the best Yusuke.