0

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? The one I have is: 0.29.21

Would appreciate some help on this. Thanks in advance!

faiz1804
  • 11
  • 2
  • `[str, bytes]` (and similar) doesn't look like an annotation that Cython can understand, or that Cython will ever be able to do anything useful with. Cython's been trying to use annotations more in recent versions so it's possible that this is causing problems. If it is a bug then I don't know that anyone here will be able to solve it though... – DavidW Aug 07 '20 at 10:48
  • Hi @DavidW, I tried changing the function declaration in the .pxd file and the problem seems to be with the last argument (the init_from_buffer). In your opinion do you know if this is the right way to declare it? If the declaration is right, then is the passing of the value to the function correct in .pyx? I guess it has something to do with the changes in Cython versions, but I am not sure. Thanks for the help! – faiz1804 Aug 07 '20 at 11:50
  • I don't know why a bool would be a string in brackets? However, both ways of declaring it should work so pick either `bool init_from_buffer` or `init_from_buffer: bool` - either should be good. Provided they're the same I think – DavidW Aug 07 '20 at 12:02
  • Thanks @DavidW! I will try this and post the result. – faiz1804 Aug 10 '20 at 08:20

2 Answers2

1

Well it turns out that I had two versions of cython on my RPi (i.e. 0.26 and 0.29) and the cmake was using the older version. Once I updated the cmake to use the 0.29 version everything was fine.

I also downloaded the latest version of DLDT (v 2020.4) and used the same cmake command as earlier. This version of DLDT checks for the minimum required Cython version which is 0.29 and this led me to the answer.

faiz1804
  • 11
  • 2
0

Another option to install and build openvino on Raspberry pi 4,

Download raspian installer 2019 version from https://download.01.org/opencv/2019/openvinotoolkit/R3/

Follow the step given in this link - https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_raspbian.html

mahinlma
  • 1,208
  • 3
  • 11
  • 24
  • The raspbian OpenVINO toolkit is 32 bit and Ubuntu is 64 bit OS. And as I mentioned, I have to use Ubuntu 18.04. Hence, this is is my worst case scenario. – faiz1804 Aug 10 '20 at 08:19