【发布时间】:2020-08-07 09:38:03
【问题描述】:
我正在尝试在 Raspberry Pi 4 上运行的 Ubuntu 18.04 上安装 DLDT 包。DLDT 的 2019 分支似乎安装正确,但存在一些问题,但可以纠正。但是,更高版本(即 2020.3)给了我以下错误:
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 = ?)
^
------------------------------------------------------------
我使用的CMAKE命令是:
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 ..
函数的声明或使用似乎存在问题。有人对此有什么建议吗?
这是兼容性问题吗?这与某些 Cython 版本问题有关吗?我拥有的是:0.29.21
不胜感激。提前致谢!
【问题讨论】:
-
[str, bytes](和类似的)看起来不像 Cython 可以理解的注释,或者 Cython 将永远能够做任何有用的事情。 Cython 一直在尝试在最近的版本中更多地使用注释,因此这可能会导致问题。如果这是一个错误,那么我不知道这里的任何人都能够解决它...... -
嗨@DavidW,我尝试更改.pxd 文件中的函数声明,问题似乎出在最后一个参数(init_from_buffer)上。在您看来,您知道这是否是正确的声明方式吗?如果声明是正确的,那么在 .pyx 中将值传递给函数是否正确?我想这与 Cython 版本的变化有关,但我不确定。感谢您的帮助!
-
我不知道为什么布尔值会是括号中的字符串?但是,声明它的两种方式都应该起作用,所以选择
bool init_from_buffer或init_from_buffer: bool- 任何一个都应该是好的。只要我认为它们是一样的 -
感谢@DavidW!我会试试这个并发布结果。
标签: cython ubuntu-18.04 raspberry-pi4 openvino