教程
Caffe Installation Tips - OpenVINO™ Toolkit
1.克隆 caffe
2. (1)mkdir build
(2)cmake ..
然后更改build/cMakeCache.txt中的CMAKE_CXX_FLAGS:STRING=-fPIC
(3)make
报错情况/usr/lib/ligflags.a
那么使用下面的方法解决
I had a similar error message and the suggested fixes above didn't work.
But I found that I had an old installation of gflags that I had built from source,
so I removed it by deleting the files /usr/local/lib/libgflags_nothreads.
a and /usr/local/lib/libgflags.a, in addition to sudo rm -rf /usr/local/lib/cmake/gflags and sudo rm -rf /usr/local/include/gflags/.
如果是缺少pycoffe
使用sudo apt-get install python-dev安装
编译完成之后,如何用python来调用,参考如下
1. 使用make pycaffe -j8 来编译pyhton接口
2.使用下面的命令,来迁移包
Caffe Installation Tips - OpenVINO™ Toolkit
注意 复制caffe的时候是复制build的上级目录中的python/caffe,而不是build里面的,然后也不用复制_caffe.o这个文件,就能 直接在python中引用
3.测试
import caffe,如果报错,查看原因,原来是numpy版本有问题 ,意思是,编译的时候用的numy 16,当前的环境是numpy15,所以使用
pip install numpy --upgrade
numpy 1.23.5可以import caffe
Successfully uninstalled numpy-1.23.5
python face_seg.py 测试结果