我想導入caffe到我的python 2.7(anaconda/mac)。我設法完成了make(全部,測試和跑步測試),都成功通過了。下面是化妝的runTest命令的一個片段:MacOS:使pycaffe給出「沒有規則,使目標」
[----------] Global test environment tear-down
[==========] 1096 tests from 150 test cases ran. (49316 ms total)
[ PASSED ] 1096 tests.
根據caffe manual下一步是要運行的命令:
make pycaffee
在那裏,我得到的錯誤:
make: *** No rule to make target `python/caffe/_caffe.cpp', needed by 'python/caffe/_caffe.so'. Stop.
我相信這與pythonpath有關,但是我找不出我缺少的東西。
這裏是我的一塊.bash_profile中的:
export PATH="//anaconda/bin:$PATH" export
PATH="/home/XXX/anaconda/bin:$PATH" export
PYTHONPATH=~/Desktop/Google_deepDream/caffe-master/python:$PYTHONPATH
而且,我的一塊生成文件的樣子:
# 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
設置'PYTHONPATH'的bash_profile命令可能不會正確解釋'~'。嘗試回顯'$ PYTHONPATH'並查看它是否具有正確的值。 (雖然我不確定這會如何影響'make'。) –
@JohnGordon謝謝,但pythonpath似乎是正確的。做完echo $ PYTHONPATH後,我得到正確的輸出。 –