問題:在make pycaffe時,可能會出現:

error: make: ***No rule to make target 'include/layers/python_layer.hpp, needed by 'python/caffe/_caffe.so'. Stop.
這是由于caffe的版本不同導致的。

解決方法:

在 include/caffe/layers/文件夾中的python_layer.hpp復制到include/caffe/文件夾下

再次make pycaffe,編譯成功


在其他地方打開python,使之可以import caffe:

添加環境變量:

cd ~

vim /.bashrc

將export PYTHONPATH=/home/nielsen/caffe-master/python:$PYTHONPATH添加到文件中

source ~/.bashrc 使之生效