Faster RCNN从demo到训练自己的数据(2)——demo篇

1.编译py-faster-rcnn库

修改py-faster-rcnn\lib\setup_cuda.py:

a. 将第14行改为'-arch=sm_35'。

b. 将第33行

include_dirs = [numpy_include, 'C:\\Programming\\CUDA\\v7.5\\include'])

改为本机的CUDA-include,如

include_dirs = [numpy_include, 'D:\\CUDA\\v8.0\\include'])

调用cmd,打开至py-faster-rcnn\lib路径下,运行命令:

python setup.py install

python setup.py build_ext --inplace

python setup_cuda.py install

可能出现以下几个问题:

(1)cl.exe failed with exit status2

方法:原因是python和VC版本冲突。找到Python\Lib\distutils\msvc9compiler.py,将第304行VERSION = get_build_version()修改为VERSION = 12(此数字为你的VC版本,VS2013为12)。

(2)Microsoft Visual C++ 9.0 is required.

方法:输入SET VS90COMNTOOLS=%VS120COMNTOOLS%(VS2013为120),输入前应该先添加VS120COMNTOOLS环境变量,如下图。

若无效,则可用(1)方法解决。

(3)No Models Import XXX

方法:缺少XXX库,调用cmd,输入pip install xxx,如pip install cython。

当提示如下时,则编译正确。

Finished processing dependencies for py-fast-rcnn-gpu==0.0.0

2.运行demo

下载已经训练好的model放在.\py-faster-rcnn-master\data\faster_rcnn_models下,下载地址用git运行.\py-faster-rcnn\data\scripts\fetch_faster_rcnn_models.sh,建议直接百度。

调用cmd,到达.\py-faster-rcnn\tools,输入

python demo.py

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值