FasterRCNN编译使用及相应问题解决

1.首先opencv是需要安装的,我用的ubuntu14.04,opencv3.0,具体安装教程可以参考网上很多,不想多提。

2.安装几个依赖包:cython,python-opencv和easydict,直接用sudo apt-get安装,网上很多用pip安装,bug比较多。

3.从github上clone项目文件,注意:一定要在clone时加入--recursive参数,不然会很麻烦,也不要直接下载:

git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git 

4.Cython模块的编译

cd py-faster-rcnn/lib

make

5.编译caffe-fast-rcnn

cd ..

cd caffe-fast-rcnn

修改这个目录下的Makefile.config(如果没有这个文件,就直接cp Makefile.config.example Makefile.config)

将CPU_ONLY := 1开关和WITH_PYTHON_LAYER开关打开:

image

image

然后在该目录下执行:make –j8 && make pycaffe

注意:之前因为我没有在这个目录下面执行make pycaffe,因此在执行第6步报了如下错误:
ImportError: /home/prlab/py-faster-rcnn/tools/../caffe-fast-rcnn/python/caffe/../../build/lib/libcaffe.so.1.0.0-rc3: undefined symbol: _ZN5caffe20curandGetErrorStringE12curandStatus
所以提醒大家少走坑。


6.运行demo.py

在环境一切就绪的情况下,将faster的模型下载下来:
在py-faster-rcnn/data/scripts 目录下,执行./fetch_faster_rcnn_models.sh 将数据下载,可能需要一定时间,慢慢等吧~~~

下载完成之后在py-faster-rcnn/tools目录下运行:

./demo.py

大功告成!!!

 
原文地址:https://www.cnblogs.com/GingerZeng/p/5789765.html