問(wèn)題:在make pycaffe時(shí),可能會(huì)出現(xiàn):
error: make: ***No rule to make target 'include/layers/python_layer.hpp, needed by 'python/caffe/_caffe.so'. Stop.
這是由于caffe的版本不同導(dǎo)致的。
解決方法:
在 include/caffe/layers/文件夾中的python_layer.hpp復(fù)制到include/caffe/文件夾下
再次make pycaffe,編譯成功
在其他地方打開(kāi)python,使之可以import caffe:
添加環(huán)境變量:
cd ~
vim /.bashrc
將export PYTHONPATH=/home/nielsen/caffe-master/python:$PYTHONPATH添加到文件中
source ~/.bashrc 使之生效