简体   繁体   中英

MacOS: make pycaffe gives “no rule to make target”

I want to import caffe to my python 2.7 (anaconda/mac). I managed to do the make (all, test, and runtest), all passed with success. Here's a snippet of the make runtest command:

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

The next step according to the caffe manual is to run the command:

make pycaffee

There I get the error:

make: *** No rule to make target `python/caffe/_caffe.cpp', needed by 'python/caffe/_caffe.so'. Stop.

I believe that this has to do with the pythonpath , however I cannot figure out what I am missing.

Here's a piece of my bash_profile:

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

PATH="/home/XXX/anaconda/bin:$PATH" export

PYTHONPATH=~/Desktop/Google_deepDream/caffe-master/python:$PYTHONPATH

Also, a piece of my makefile looks like:

# 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

I also have all the python dependencies:

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

Try to uncomment your MakeFile.config in a way like WITH_PYTHON_LAYER := 1 .

Make sure you have the _caffe.so in caffe_dir/python/caffe .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM