Python找不到mvnc模块

时间:2018-09-11 03:07:10

标签: python python-import ubuntu-18.04

我一直在尝试设置由intel创建的movidius库,但是当我尝试导入mvnc软件包时,我一直陷入困境。

要设置mvnc,请按照此处的说明进行操作:Real-time object detection with movidius

当需要测试安装是否有效时,我运行

  

创建例子

每当我运行它时都会给出此错误。

Traceback (most recent call last):
  File "/usr/local/bin/mvNCCompile", line 25, in <module>
    from Models.Blob import *
  File "/usr/local/bin/ncsdk/Models/Blob.py", line 19, in <module>
    from Controllers.MiscIO import *
  File "/usr/local/bin/ncsdk/Controllers/MiscIO.py", line 35, in <module>
    from mvnc import mvncapi

所以我想知道如何让python识别mvnc模块,以便将其导入到我的任何代码中。谢谢您的帮助!

我正在Windows 10计算机上的虚拟机中运行Ubuntu 18.04.1 LTS

这是完整的命令行输出:

./install-opencv.sh
Installing opencv python for non-Raspbian
[sudo] password for odyssey: 
Requirement already satisfied: opencv-python in /usr/local/lib/python3.6/dist-packages
Requirement already satisfied: numpy>=1.11.3 in /usr/lib/python3/dist-packages (from opencv-python)
Requirement already satisfied: opencv-contrib-python in /usr/local/lib/python3.6/dist-packages
Requirement already satisfied: numpy>=1.11.3 in /usr/lib/python3/dist-packages (from opencv-contrib-python)

make examples starting.
(cd examples; make)
make[1]: Entering directory '/home/odyssey/workspace/ncsdk/examples'
make -C apps/. 
make[2]: Entering directory '/home/odyssey/workspace/ncsdk/examples/apps'
make -C hello_ncs_py/. 
make[3]: Entering directory '/home/odyssey/workspace/ncsdk/examples/apps/hello_ncs_py'
nothing to make, use 'make run' to run.
make[3]: Leaving directory '/home/odyssey/workspace/ncsdk/examples/apps/hello_ncs_py'
make -C multistick_cpp/. 
make[3]: Entering directory '/home/odyssey/workspace/ncsdk/examples/apps/multistick_cpp'

making googlenet
(cd ../../caffe/GoogLeNet; make compile; cd ../../apps/multistick_cpp; cp ../../caffe/GoogLeNet/graph ./googlenet.graph;)
make[4]: Entering directory '/home/odyssey/workspace/ncsdk/examples/caffe/GoogLeNet'

making prereqs
(cd ../../data/ilsvrc12; make)
make[5]: Entering directory '/home/odyssey/workspace/ncsdk/examples/data/ilsvrc12'
make[5]: Leaving directory '/home/odyssey/workspace/ncsdk/examples/data/ilsvrc12'

making prototxt
Prototxt file already exists

making caffemodel
caffemodel file already exists

making compile
mvNCCompile -w bvlc_googlenet.caffemodel -s 12 deploy.prototxt
Traceback (most recent call last):
  File "/usr/local/bin/mvNCCompile", line 25, in <module>
    from Models.Blob import *
  File "/usr/local/bin/ncsdk/Models/Blob.py", line 19, in <module>
    from Controllers.MiscIO import *
  File "/usr/local/bin/ncsdk/Controllers/MiscIO.py", line 35, in <module>
    from mvnc import mvncapi
ModuleNotFoundError: No module named 'mvnc'
Makefile:80: recipe for target 'compile' failed
make[4]: *** [compile] Error 1
make[4]: Leaving directory '/home/odyssey/workspace/ncsdk/examples/caffe/GoogLeNet'
cp: cannot stat '../../caffe/GoogLeNet/graph': No such file or directory
Makefile:9: recipe for target 'googlenet' failed
make[3]: *** [googlenet] Error 1
make[3]: Leaving directory '/home/odyssey/workspace/ncsdk/examples/apps/multistick_cpp'
Makefile:12: recipe for target 'multistick_cpp/.' failed
make[2]: *** [multistick_cpp/.] Error 2
make[2]: Leaving directory '/home/odyssey/workspace/ncsdk/examples/apps'
Makefile:12: recipe for target 'apps/.' failed
make[1]: *** [apps/.] Error 2
make[1]: Leaving directory '/home/odyssey/workspace/ncsdk/examples'
Makefile:57: recipe for target 'examples' failed
make: *** [examples] Error 2

1 个答案:

答案 0 :(得分:1)

要执行典型的NCSDK安装,请在主机上使用以下命令:

    git clone -b ncsdk2 http://github.com/Movidius/ncsdk && cd ncsdk && make install

您必须启用USB 3.0控制器并为虚拟机创建USB白名单过滤器。

USB 3.0功能需要VirtualBox扩展包。

关闭虚拟机

在VirtualBox Manager上选择虚拟机后:

Open Settings -> USB
    Check “Enable USB Controller”
    Check “USB 3.0 (xHCI) Controller”
    Add a new USB filter with Vendor ID: 03e7
        The other filter fields can be blank.
    Add a new USB filter with Vendor ID: 040e
        The other filter fields can be blank

在ncsdk目录中使用以下命令下载必要的先决条件和模型并构建所有示例:

make examples