调试faster_rcnn及常见问题

来源:互联网 发布:淘宝api 获取订单信息 编辑:程序博客网 时间:2024/05/22 15:49

1.可能需要Python安装包:cython,python-opencv,easydict
2.下载 git clone –recursive https://github.com/rbgirshick/fast-rcnn.git
3.生成Cython模块

    cd $FRCN_ROOT/lib     make

其中FRCN_ROOT为faster_rcnn的根目录
4.Make faster_rcnn
cd caffe-fast-rcnn 将Makefile.config.example 改为Makefile.config 并且在Makefile.config里去掉注释 WITH_PYTHON_LAYER:=1

make -j16 && make pycaffe
其中可能出现错误如下
In file included from ./include/caffe这里写代码片/util/cudnn.hpp:5:0,
from ./include/caffe/util/device_alternate.hpp:40,
from ./include/caffe/common.hpp:19,
from src/caffe/util/benchmark.cpp:3:
/usr/local/cuda/include/cudnn.h:500:27: note: declared here
这是因为cudnn版本问题。faster rcnn 代码默认是使用的cudnn v4, 但是为了体验最新的v5, 或者使用GTX1080 ,我们编译faster rcnn的时候就会报错。解决办法 http://blog.csdn.net/u010733679/article/details/52221404
还可能http://blog.csdn.net/u013498583/article/details/74231058
编译错误很可能是版本不兼容。
5.运行demo
下载训练好的模型,下载后这个faster_rcnn_models文件夹在$FRCN_ROOT/data下面,可以从data/README.md中查看关于这个的详细介绍。这些模型是在VOC 2007 上训练的。

    cd $FRCN_ROOT    ./data/scripts/fetch_faster_rcnn_models.sh
这里有个小建议,就是下载模型时,直接去脚本文件中复制URL使用迅雷下载更快。运行demo
    cd $FRCN_ROOT    ./tools/demo.py
这个demo展示了使用在PASCAL VOC 2007上训练的VGG16网络来进行目标检测。
原创粉丝点击