caffe配置python接口

怎么安装caffe在这:http://blog.csdn.net/Dod_Jdi/article/details/78635061
不知道Ubuntu为什么不能编辑已经发表的博客,再开一篇吧

进入caffe安装目录然后编译

make  pycaffe
make all  
make test  
make runtest  

在这里 我出现了

python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: 没有那个文件或目录
compilation terminated. 
Makefile:507: recipe for target ‘python/caffe/_caffe.so’ failed
make: <em>*</em> [python/caffe/_caffe.so] Error 1</p>

这样的错误,于是我执行了以下方案

sudo apt-get install python-numpy

然后在重新执行make命令

把环境变量路径放到 ~/.bashrc文件中:sudo gedit ~/.bashrc
添加export PYTHONPATH=/home/peng/software/caffe/python:$PYTHONPATH

然后接下来进行测试
测试Caffe的Python接口

python
import caffe

如果没有报错,证明安装成功。

猜你喜欢

转载自blog.csdn.net/dod_jdi/article/details/78635366