Ubuntu14.04安装py-Faster-rcnn
一、安装caffe依赖
1.1 General dependencies
$ sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler $ sudo apt-get install --no-install-recommends libboost-all-dev
1.2 安装编译openblas
参考资料:http://www.cnblogs.com/llxrl/p/5292119.html
$ sudo apt-get install libopenblas-dev
$ git clone https://github.com/xianyi/OpenBLAS.git
$ cd OpenBLAS
$ make -j8
$ sudo make PREFIX=/usr/local/OpenBLAS install
1.3 Remaining dependencies
$ sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
二、编译py-faster-rcnn
2.1 下载
~RCNN$ git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git
2.2 编译
~/RCNN/py-faster-rcnn/lib$ make -j8
2.3 rbgirshick的py-faster-rcnn实现所依赖的caffe版本较旧,需要修改caffe
2.3.1
$ cd caffe-fast-rcnn $ git remote add caffe https://github.com/BVLC/caffe.git $ git fetch caffe $ git merge -X theirs caffe/master
2.3.2
打开caffe-fast-rcnn/include/caffe/layers
删除self_.attr("phase") = static_cast<int>(this->phase_);
(line29)
参考资料:http://blog.csdn.net/u010167269/article/details/50703923
三、编译pycaffe
3.1 修改Makefile.config文件
~/RCNN/py-faster-rcnn/caffe-fast-rcnn$ cp Makefile.config.example Makefile.config ~/RCNN/py-faster-rcnn/caffe-fast-rcnn$ gedit Makefile.config
3.2 编译caffe
~/RCNN/py-faster-rcnn/caffe-fast-rcnn$make -j8
3.3 编译pycaffe
$~/RCNN/py-faster-rcnn/caffe-fast-rcnn$make pycaffe
四、测试
4.1下载faster_rcnn_models与VOCdevkit2007,将这两个文件夹放入~/RCNN/py-faster-rcnn/data/
4.2
$ cd ~/RCNN/py-faster-rcnn/tools/ ~/RCNN/py-faster-rcnn/tools$ python demo.py