1.建立虚拟环境
参考链接:https://blog.csdn.net/u014090429/article/details/117163428
2.配置Makefile
主要配置如下内容
PYTHON_LIBRARIES := boost_python3 python3.5m
PYTHON_INCLUDE := /usr/include/python3.5 \
/home/yonghuming/software/caffe_python3/lib/python3.5/site-packages/numpy/core/include
其中需要先安装一些必须库
pip install numpy
pip install opencv-python
pip install -U scikit-image
则可得到路径
/home/yonghuming/software/caffe_python3/lib/python3.5/site-packages/numpy/core/include
执行whereis python,查看python的include路径,如果有直接添加即可,如果没有可以执行如下操作
apt install python3.5-dev
如果执行make pycaffe -j 报如下错误
/usr/bin/ld: cannot find -lboost_python3
则参考如下链接解决
https://blog.csdn.net/u014090429/article/details/119539234
参考链接:
https://stackoverflow.com/questions/43656859/not-include-directory-in-python-3-6-with-virtualenv