Two errors while running Caffe

2.7k views Asked by At

I've installed Caffe on my Ubuntu 14.04 machine. the make runtest runs perfectly fine with 581 tests passed. I'm trying to work with the command line and python interface and getting the following two errors:

  1. Command Line Interface: When I try to run the command caffe, I'm getting the following error:

    No command 'caffe' found, did you mean: Command 'caff' from package 
     'signing-party' (universe)
    caffe: command not found 
    
  2. Python Interface: When I run the command make pycaffe, I'm getting the following error:

    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

There are 2 answers

1
Anoop K. Prabhu On BEST ANSWER

Make sure that numpy is installed correctly and the path is mentioned to detect the newly installed library. The steps are provided in Caffe website itself.

For the 'Caffe' command to work, you will have to step into the folder where the 'Caffe' executable is created and then try running the executable through the terminal.

0
madx On

Regarding the second problem you had, I had the same problem, I solved uncommenting this line inside the 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