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

DLDT install on Ubuntu 18.04 on RPi4 - Cython File error

kany0505
Beginner
1,525 Views

I am trying to install the DLDT package on Ubuntu 18.04 running on the Raspberry Pi 4. The 2019 branch of DLDT seems to install correctly with some issues but can be rectified. However, the later version (i.e. 2020.3) is giving me the below error:

Error compiling Cython file:
------------------------------------------------------------
...
    #  Usage example:\n
    #  ```python
    #  ie = IECore()
    #  net = ie.read_network(model=path_to_xml_file, weights=path_to_bin_file)
    #  ```
    cpdef IENetwork read_network(self, model: [str, bytes], weights: [str, bytes] = "", init_from_buffer: bool = "False"):
         ^
------------------------------------------------------------

/home/ubuntu/dldt/inference-engine/ie_bridges/python/src/openvino/inference_engine/ie_api.pyx:136:10: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
cdef class LayersStatsMap(dict):
    cdef C.IENetwork net_impl

cdef class IECore:
    cdef C.IECore impl
    cpdef IENetwork read_network(self, model : [str, bytes], weights : [str, bytes] = ?, bool init_from_buffer = ?)
                               ^
------------------------------------------------------------

The CMAKE command I use is:

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/bin/python3.6 -DPYTHON_LIBRARY=/usr/lib/aarch64-linux-gnu/libpython3.6m.so -DPYTHON_INCLUDE_DIR=/usr/include/python3.6 ..

It seems like there is an issue with the declaration of the function or the usage of it. Is there any advice on this from anybody?

Is this a compatibility issue? Is this related to some Cython version issues? May I know what version of Cython is required for this? The one I have is: 0.29.21

I know that there is a raspbian version of the openVINO tool kit but my project requires Ubuntu 18.04 and hence I have to try it with this.

Would appreciate some help on this. Thanks in advance!

0 Kudos
1 Solution
Luis_at_Intel
Moderator
1,500 Views

Hi @kany0505 ,

 

Thanks for reaching out. You should be able to install OpenVINO™ Toolkit from source on Raspberry* Pi 4 with Ubuntu* 18.04 (64-bit). Although this is not officially supported, this should be possible to use with Intel® Neural Compute Stick 2. I've tested this with v2020.4 and the build process completes successfully. Find environment details and steps taken below, hope this helps!

Environment Details:

 

Ubuntu 18.04.4 LTS (64-bit)
Raspberry Pi 4
CMake version 3.14.4 (built from source)
Python 3.6.9
Cython version 0.29.17

 

Build Steps:

 

git clone https://github.com/openvinotoolkit/openvino.git
cd openvino
git checkout 2020.4
cd inference-engine
git submodule update --init --recursive
cd ../openvino
sh ./install_dependencies.sh
cd inference-engine/ie_bridges/python
pip3 install -r requirements.txt
cd ../../../ && mkdir build && cd build

cmake -DCMAKE_BUILD_TYPE=Release \
-DENABLE_MKL_DNN=OFF \
-DENABLE_CLDNN=OFF \
-DENABLE_GNA=OFF \
-DENABLE_SSE42=OFF \
-DTHREADING=SEQ \
-DENABLE_SAMPLES=ON \
-DENABLE_OPENCV=ON \
-DENABLE_PYTHON=ON \
-DPYTHON_EXECUTABLE=/usr/bin/python3.6 \
-DPYTHON_LIBRARY=/usr/lib/aarch64-linux-gnu/libpython3.6m.so \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.6 \
..

 

If you want to use your own OpenCV* build turn off with -DENABLE_OPENCV=OFF and don't forget to specify OpenCV_DIR where the cmake file is located, something similar to:

export OpenCV_DIR=/usr/local/lib/cmake/opencv4/

Once the build process completes, don't forget to export libraries:

 

export PYTHONPATH=<path-to>/openvino/bin/aarch64/Release/lib/python_api/python3.6/
export LD_LIBRARY_PATH=<path-to>/openvino/bin/aarch64/Release/lib/

 

 

Regards,

Luis

View solution in original post

0 Kudos
2 Replies
Luis_at_Intel
Moderator
1,501 Views

Hi @kany0505 ,

 

Thanks for reaching out. You should be able to install OpenVINO™ Toolkit from source on Raspberry* Pi 4 with Ubuntu* 18.04 (64-bit). Although this is not officially supported, this should be possible to use with Intel® Neural Compute Stick 2. I've tested this with v2020.4 and the build process completes successfully. Find environment details and steps taken below, hope this helps!

Environment Details:

 

Ubuntu 18.04.4 LTS (64-bit)
Raspberry Pi 4
CMake version 3.14.4 (built from source)
Python 3.6.9
Cython version 0.29.17

 

Build Steps:

 

git clone https://github.com/openvinotoolkit/openvino.git
cd openvino
git checkout 2020.4
cd inference-engine
git submodule update --init --recursive
cd ../openvino
sh ./install_dependencies.sh
cd inference-engine/ie_bridges/python
pip3 install -r requirements.txt
cd ../../../ && mkdir build && cd build

cmake -DCMAKE_BUILD_TYPE=Release \
-DENABLE_MKL_DNN=OFF \
-DENABLE_CLDNN=OFF \
-DENABLE_GNA=OFF \
-DENABLE_SSE42=OFF \
-DTHREADING=SEQ \
-DENABLE_SAMPLES=ON \
-DENABLE_OPENCV=ON \
-DENABLE_PYTHON=ON \
-DPYTHON_EXECUTABLE=/usr/bin/python3.6 \
-DPYTHON_LIBRARY=/usr/lib/aarch64-linux-gnu/libpython3.6m.so \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.6 \
..

 

If you want to use your own OpenCV* build turn off with -DENABLE_OPENCV=OFF and don't forget to specify OpenCV_DIR where the cmake file is located, something similar to:

export OpenCV_DIR=/usr/local/lib/cmake/opencv4/

Once the build process completes, don't forget to export libraries:

 

export PYTHONPATH=<path-to>/openvino/bin/aarch64/Release/lib/python_api/python3.6/
export LD_LIBRARY_PATH=<path-to>/openvino/bin/aarch64/Release/lib/

 

 

Regards,

Luis

0 Kudos
kany0505
Beginner
1,487 Views

Hi Luis,

Thank you for the response.

I followed these exact steps before as well and the problem was the cython version. I had two different versions of cython i.e. 0.26 and 0.29. Cmake was using the older version and hence it was failing. Once I updated cmake to the right version, everything compiled well. 

Thank you for the help.

0 Kudos
Reply