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

When I import openvino.inference_engine, I faced crash the python in Raspberry Pi4, Ubuntu18.04.

Hello, everyone.

I'm trying to use OpenVINO and NCS2 in my Raspberry Pi4 machine. 

I successfully built the OpenVINO for Python3.7 environment as following:

https://software.intel.com/content/www/us/en/develop/articles/arm64-sbc-and-ncs2.html

https://github.com/openvinotoolkit/openvino/issues/1550

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.

 

0 Kudos
12 Replies
Highlighted
Beginner
174 Views

0 Kudos
Highlighted
Moderator
156 Views

Hi Yusuke,

 

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

 

Regards,

Rizal


0 Kudos
Highlighted
Beginner
153 Views

Hi Rizal,

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.

0 Kudos
Highlighted
Moderator
145 Views

Hi Yusuke,


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.


Regards,

Rizal


0 Kudos
Highlighted
Beginner
141 Views

Hi Rizal,

Yes, you are right.
Currently only ubuntu20.04 LTS is distributed in https://ubuntu.com/download/raspberry-pi

I installed 18.04LTS in this link previously. Sorry I can't share the answer which you are looking for.

0 Kudos
Highlighted
Moderator
103 Views

Hi Yusuke, do you have a copy of the ARM Ubuntu 18.04 image that you could share?


Regards,

Rizal


0 Kudos
Highlighted
Beginner
86 Views

Hi Rizal, thank you for your support.
I changed plan to use Ubuntu20.04 LTS Server and Ubuntu Mate, however I still got segmentation fault even if I didn't use virtualenv.
Could you check it by using Ubuntu20.04LTS Server?

0 Kudos
Highlighted
Beginner
84 Views

And also my make option is as following:

----

sudo cmake  -DCMAKE_BUILD_TYPE=Release \

-DENABLE_MKL_DNN=OFF \

-DENABLE_CLDNN=OFF \

-DENABLE_GNA=OFF \

-DENABLE_SSE42=OFF \

-DTHREADING=SEQ \

-DENABLE_OPENCV=OFF \   

-DENABLE_PYTHON=ON \

-DPYTHON_EXECUTABLE=/usr/local/bin/python3.7 \

-DPYTHON_LIBRARY=/usr/local/lib/python3.7/config-3.7m-aarch64-linux-gnu/libpython3.7m.a \

-DPYTHON_INCLUDE_DIR=/usr/local/include/python3.7m \

..

0 Kudos
Highlighted
Moderator
72 Views

Hi Yusuke,


Replicating your case may take a longer time.

I would like to confirm you are using the 64bit version of the OS?


Regards,

Rizal


0 Kudos
Highlighted
Beginner
70 Views

Hi Rizal,

Thank you for supporting.
Yes, I'm using 64bit Ubuntu 18/20 LTS.

0 Kudos
Highlighted
Moderator
30 Views

Hi Yusuke,

 

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?

 

Regards,

Rizal

 

0 Kudos
Highlighted
Beginner
8 Views

Hi Rizal,

Thank you for your supporting. I will try it!
By the way, Is your environment Ubuntu20.04Server? and built latest version of OpenVINO?

Thanks,
Yusuke

0 Kudos