MacOS:让pycaffe给出"没有规则来制作目标"

时间:2016-07-25 16:00:23

标签: python c++ debugging caffe

我想将caffe导入我的python 2.7(anaconda / mac)。我设法做了make(all,test和runtest),都成功通过了。这是make runtest命令的片段:

[----------] Global test environment tear-down
[==========] 1096 tests from 150 test cases ran. (49316 ms total)
[  PASSED  ] 1096 tests.

根据caffe manual的下一步是运行命令:

make pycaffee

我收到错误:

  

make:***没有规则要制作目标`python / caffe / _caffe.cpp',需要   '蟒/ CAFFE / _caffe.so&#39 ;.停止。

我认为这与 pythonpath 有关,但是我无法弄清楚我错过了什么。

这是我的bash_profile的一部分:

  

export PATH =" // anaconda / bin:$ PATH"出口

     

PATH =" /家庭/ XXX /水蟒/ bin中:$ PATH"出口

     

PYTHONPATH =〜/桌面/ Google_deepDream / CAFFE主/蟒:$ PYTHONPATH

另外,我的一个makefile看起来像是:

# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
#PYTHON_INCLUDE := /usr/include/python2.7 \
#       /usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's nin root.
 ANACONDA_HOME := ~/../../anaconda
 PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
         $(ANACONDA_HOME)/include/python2.7 \
         $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \

# We need to be able to find libpythonX.X.so or .dylib.
#PYTHON_LIB := /usr/lib
PYTHON_LIB := $(ANACONDA_HOME)/lib

我也有所有python依赖项:

for req in $(cat requirements.txt); do pip install $req; done

1 个答案:

答案 0 :(得分:0)

尝试以MakeFile.config之类的方式取消注释WITH_PYTHON_LAYER := 1

确保_caffe.so中有caffe_dir/python/caffe