运行Caffe时出现两个错误

时间:2015-06-08 19:11:33

标签: python deep-learning caffe

我在我的Ubuntu 14.04机器上安装了Caffe。通过581测试,make runtest完全正常运行。我试图使用命令行和python接口并获得以下两个错误:

  1. 命令行界面:当我尝试运行命令caffe时,我收到以下错误:

    No command 'caffe' found, did you mean: Command 'caff' from package 
     'signing-party' (universe)
    caffe: command not found 
    
  2. Python界面:当我运行命令make pycaffe时,我收到以下错误:

    CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
    python/caffe/_caffe.cpp:9:31: fatal error: numpy/arrayobject.h: No such file 
    or directory
    #include <numpy/arrayobject.h>
                                  ^
    compilation terminated.
    make: *** [python/caffe/_caffe.so] Error 1
    

2 个答案:

答案 0 :(得分:2)

确保正确安装numpy并提及路径以检测新安装的库。 Demo在Caffe网站上提供。

要使'Caffe'命令起作用,您必须进入创建'Caffe'可执行文件的文件夹,然后尝试通过终端运行可执行文件。

答案 1 :(得分:1)

关于你遇到的第二个问题,我遇到了同样的问题,我解决了在Makefile.config中取消注释这一行:

# Decomment le line uncommented below:
# Homebrew installs numpy in a non standard path (keg only)
PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
# PYTHON_LIB += $(shell brew --prefix numpy)/lib