导入错误:无法导入名称'label_cython'

时间:2018-02-05 05:48:38

标签: ubuntu-16.04 caffe intel importerror pycaffe

我是Ubuntu16.04以及caffe的新用户。

几天前,我正在与英特尔Movidius合作,使用ncappzoo的东西并且有效。之后我尝试下载工具包和API来玩。当我验证工具包的安装时,我发现导入caffe的函数不再有效。它一直给我这个错误。

我尝试使用谷歌搜索,但没有找到解决方案。 $PYTHONPATH已经过检查和验证。我还重新安装了scikit-image

这是一个乱七八糟的东西,它反弹回给我:

  File "<stdin>", line 1, in <module>  
  File "/workspace/SDK/caffe/python/caffe/__init__.py", line 1, in <module>  
    from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer  
  File "/workspace/SDK/caffe/python/caffe/pycaffe.py", line 15, in <module>  
    import caffe.io  
  File "/workspace/SDK/caffe/python/caffe/io.py", line 4, in <module>  
    from skimage.transform import resize  
  File "/usr/local/lib/python3.5/dist-packages/skimage/transform/__init__.py", line 1, in <module>  
    from .hough_transform import (hough_line, hough_line_peaks,
  File "/usr/local/lib/python3.5/dist-packages/skimage/transform/hough_transform.py", line 3, in <module>  
    from .. import measure  
  File "/usr/local/lib/python3.5/dist-packages/skimage/measure/__init__.py", line 6, in <module>  
    from ._regionprops import regionprops, perimeter
  File "/usr/local/lib/python3.5/dist-packages/skimage/measure/_regionprops.py", line 7, in <module>  
    from ._label import label  
  File "/usr/local/lib/python3.5/dist-packages/skimage/measure/_label.py", line 1, in <module>   
    from ._ccomp import label_cython as clabel  
ImportError: cannot import name 'label_cython'  

知道出了什么问题吗?

1 个答案:

答案 0 :(得分:1)

我们可以使用ncappzoo提供的所有应用/网络而不会出现任何问题。

Our configuration is as follows:
    movidius@osboxes:~$ python --version
    Python 2.7.12
    movidius@osboxes:~$ echo $PYTHONPATH
    :/opt/movidius/caffe/python
    movidius@osboxes:~$ lscpu | grep "Model name"
    Model name: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz
    movidius@osboxes:~$ lsb_release -a
    No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.3 LTS Release: 16.04 Codename: xenial

假设您已下载ncsdk然后安装它。如果没有,

首先我们需要安装&#39; ncsdk&#39;这可以实现深度神经网络的快速原型设计,验证和部署

请按照下面提到的链接安装ncsdk (它包括软件工具,API和示例)

  1. https://developer.movidius.com/start
  2. https://movidius.github.io/ncsdk/install.html

    一旦ncsdk安装完成,您就可以使用ncappzoo中提供的所有应用程序/网络。