matab版的faster-rcnn的window配置(cpu运行)

1、参考博客

http://blog.csdn.net/mr_curry/article/details/54745116

http://blog.csdn.net/btbujhj/article/details/53070810

在已经配置好的caffe-master(但未添加roi_pooling_layer)的情况下,将roi_pooling_layer头文件,cu文件和cpp文件手动加入到libcaffe为防止出现其他问题。参考博客http://www.cnblogs.com/LaplaceAkuir/p/6445189.htmlcaffe-master/include/caffe下的所有头文件加入到libcaffe项目的头文件中,caffe-master/src/caffecppcu文件加入到libcaffe的源文件和cu文件中加完成后,再次重新编译整个项目。重新生成libcaffe后,再生成matcaffe。也可以整个工程都全部重新生成。

 

 

2、资源下载:

Matlab版本的Faster R-CNNhttps://github.com/ShaoqingRen/faster_rcnn解压后,把我们得到的matcaffe文件夹复制到external/caffe/目录下demo是在这个目录下搜的函数)。

下载资源faster_rcnn_final_model.zip,百度云http://pan.baidu.com/s/1mioahvU,将output文件夹放置在项目faster_rcnn-master根目录

 

3、修改m文件

为运行faster_rcnn-master\experiments文件夹下的demoscript_faster_rcnn_demo.m这个文件注释掉以下两行,加上caffe.set_mode_cpu,如下:

%% -------------------- CONFIG --------------------

opts.caffe_version = 'caffe_faster_rcnn';

%注释opts.gpu_id = auto_select_gpu;

%注释active_caffe_mex(opts.gpu_id, opts.caffe_version);

 

 

添加caffe.set_mode_cpu;

 

然后把opts.use_gpu选项改了:

opts.use_gpu   = false;

 

4、运行demo

cd  faster_rcnn-master/

addpath('experiments/') %添加路径

script_faster_rcnn_demo

 

在运行过程中出现错误如下:

caffe 未定义与 'double' 类型的输入参数相对应的函数 'nms_mex'

这是由于没有生成nms mex文件,可以通过运行文件根目录下的:faster_rcnn_build.m,发现出现无法打开 nms_gpu_mex.o”,需要打开.\functions\nms\nvmex.m 文件,修改Host_Compiler_Location为自己的VS安装路径,重新编译faster_rcnn_build.m通过。

 

重新运行script_faster_rcnn_demo,得到四副图像的运行结果

 

Vgg-16网络其慢无比,

fast_rcnn startup done

001763.jpg (500x375): time 511.408s (resize+conv+proposal: 167.394s, nms+regionwise: 344.014s)

004545.jpg (500x375): time 900.987s (resize+conv+proposal: 345.407s, nms+regionwise: 555.581s)

000542.jpg (500x375): time 994.914s (resize+conv+proposal: 231.380s, nms+regionwise: 763.535s)

000456.jpg (500x375): time 1297.557s (resize+conv+proposal: 618.641s, nms+regionwise: 678.916s)

001150.jpg (500x375): time 1005.064s (resize+conv+proposal: 313.427s, nms+regionwise: 691.637s)

mean time: 941.986s

Cleared 0 solvers and 4 stand-alone nets

还是cpu太慢了

 

结果比较http://blog.csdn.net/cgt19910923/article/details/55505557,大体相同,但是有细微差异

 

有两种网络可以选择,在script_faster_rcnn_demo.m这个地方。上面是VGG-16,下面是zf5,上面的网络太大,奇慢无比。

model_dir = fullfile(pwd, 'output', 'faster_rcnn_final', 'faster_rcnn_VOC0712_vgg_16layers'); %% VGG-16

%model_dir = fullfile(pwd, 'output', 'faster_rcnn_final', 'faster_rcnn_VOC0712_ZF'); %% ZF

 

转载于:https://www.cnblogs.com/huanyin/p/8087990.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值