Faster rcnn 训练自己的数据—环境搭建

来源:互联网 发布:美国ip代理软件 编辑:程序博客网 时间:2024/06/05 05:23

faster-rcnn Python版本源码地址:https://github.com/rbgirshick/py-faster-rcnn

这篇文章主要介绍搭建用faster-rcnn进行目标检测所需的环境。

1.电脑上已经有可运行caffe所需的环境

2.下载faster-rcnn python版本源码

git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git  
3.进入caffe-faster-rcnn中,编译caffe,可参考我之前的博客:http://blog.csdn.net/w113691/article/details/77937132(直接从3.编译caffe开始)。这里需要注意的是在修改Makefile.config文件时,把WITH_PYTHON_LAYER := 1前的#去掉

# In your Makefile.config, make sure to have this line uncommented  WITH_PYTHON_LAYER := 1  # Unrelatedly, it's also recommended that you use CUDNN  USE_CUDNN := 1
然后make all -j8,编译通过。(编译不通过,可以去网上找答案,基本上都能找得到。)

4. 然后在终端 make pycaffe 一下,一定要执行这条指令,不然后面会报错:No import named _caffe.

5. 运行faster-rcnn里的demo.py

cd py-faster-rcnn/tools  ./tools/demo.py

出现下图表示,环境已经搭建好了。