对于caffe版本的faster rcnn的编译问题

对于caffe版本的faster rcnn的编译问题(centos7)

1.在下载faster rcnn之前,centos7上下载caffe,并编译成功,编译caffe可以参考

caffe编译

2.下载py-faster-rcnn
git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git
3.编译faster-rcnn
cd $FRCN_ROOT/lib
make
cd FRCN_ROOT/caffe-fast-rcnn
# 此时将之前系统编译好的caffe目录下Makefile.config 和 Makefile 复制到 caffe-fast-rcnn目录下
由于faster-rcnn上的caffe是很早的版本,所以在编译的时候,有些文件需要替换,具体替换的文件如下:
1.caffe-fast-rcnn目录下的src文件下/caffe/layers中的文件如果能在系统caffe对应位置找到的,都需要替换掉,其中自定义的roi_pooling_layer.cpp,roi_pooling_layer.cu等文件保留。
2.将caffe-fast-rcnn目录下的include文件夹替换成系统caffe下的include文件夹,将caffe-fast-rcnn用于自定义层(roi pooling层等)的头文件复制在对应位置。
3.用编辑器打开/src/caffe/proto/下的caffe.proto,在message LayerParameter下添加:
  optional ROIPoolingParameter roi_pooling_param = 8266711;
  在caffe.proto下添加:
  message ROIPoolingParameter {
  // Pad, kernel size, and stride are all given as a single value for equal
  // dimensions in height and width or as Y, X pairs.
  optional uint32 pooled_h = 1 [default = 0]; // The pooled output height
  optional uint32 pooled_w = 2 [default = 0]; // The pooled output width
  // Multiplicative spatial scale factor to translate ROI coords from their
  // input scale to the scale used when pooling
  optional float spatial_scale = 3 [default = 1];
}
上述步骤后,cd caffe-fast-rcnn,执行make -j32,顺利的话,应该不会有大问题。
接着执行make pycaffe -j32,在这个过程中可能会出现问题,如果是报caffe-fast-rcnn/python/_caffe.cpp的问题建议直接替换成系统对应的文件,其他的语法问题都是小问题,可以在网上找到,在相应文件中修改保存即可。
4.运行demo程序,如果能够正常检测,说明faster rcnn已经成功编译
附录

caffe-fast-rcnn
提取码:4nbr
上面是替换后的caffe-fast-rcnn文件夹链接,我系统安装的caffe版本是1.0.0,如果有需要的话可以直接下载该文件,替换掉原来的caffe-fast-rcnn文件夹,执行make clean,接着再执行make -j32,make pycaffe -j32即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值