Py-Faster-RCNN(Caffe)的安装
1.git clone —recursive https://github.com/rbgirshick/py-faster-rcnn.git
2.sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler libhdf5-dev
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install python-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-devsudo apt-get install --no-install-recommends libboost-all-dev
3. 安装 Cython, easydict, opencv
这三个库一定要记得安装,否则会报错
sudo pip install cython
sudo pip install easydict
sudo apt-get install python-opencv4.在 /py-faster-rcnn/lib directory 目录下执行
make
, 会出现如下结果:
5.修改makefile.config
8行
USE_CUDNN := 1
87行
WITH_PYTHON_LAYER := 1
90行
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
其他项,比如atlas、anaconda的python等,看情况修改,不修改也OK。
6。修改makefile
1.
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial
2.LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial
7.
编译caffe-fast-rcnn
需要先更新用到的caffe:原版py-faster-rcnn依赖的caffe比较老,不支持cudnnv5,那就更新下对应的源码。提供两种版本,方法1更简单些。
利用git修改 参考https://www.cnblogs.com/zf-blog/p/6701710.html
http://blog.csdn.net/10km/article/details/62418583
cd caffe-fast-rcnn git remote add caffe https://github.com/BVLC/caffe.git git fetch caffe git merge -X theirs caffe/master
然后在合并之后注释掉include/caffe/layers/python_layer.hpp文件里的self_.attr(“phase”) = static_cast(this->phase_)
参考:http://blog.csdn.net/nicky_lyu/article/details/53181434
https://www.cnblogs.com/zjutzz/p/6034408.html
make runtest的时候出现 Check failed: error == cudaSuccess (30 vs. 0) unknown error
(网上也有说把makefile.config文件中的compute改了 我的显卡是gtx 1050 照着官网改成了61改完再加sudo就成功了 估计不用改)
sudo make runtest ok!