2

我已经在我的 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
    
4

2 回答 2

2

确保正确安装了 numpy 并提到了路径以检测新安装的库。Caffe 网站本身提供了这些步骤。

要使“Caffe”命令正常工作,您必须进入创建“Caffe”可执行文件的文件夹,然后尝试通过终端运行该可执行文件。

于 2015-06-08T19:58:15.953 回答
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
于 2015-12-05T23:28:00.577 回答