py-faster-rcnn + cpu安装及训练自己的数据集

本文安装python版本的faster-rcnn项目。
matlab版本请移步:https://github.com/ShaoqingRen/faster_rcnn
python版本项目主页:https://github.com/rbgirshick/py-faster-rcnn

下面分两部分来讲解,第一部分为py-faster-rcnn及caffe框架安装。第二部分讲解如何修改相关文件,训练自己的数据集。

第一部分 安装

把项目代码clone下来, 注意是递归下载,里面包含项目自带的caffe,跟原版的caffe略有不同,一定要注意:

git clone --recursive  https://github.com/rbgirshick/py-faster-rcnn.git

安装python包cython, 使用pip安装:

sudo pip install cython

编译cython

cd /py-faster-rcnn/lib
修改setup.py文件,注释掉GPU相关代码,如下:
#CUDA = locate_cuda()
#self.set_executable('compiler_so', CUDA['nvcc'])
# Extension('nms.gpu_nms',
        ['nms/nms_kernel.cu', 'nms/gpu_nms.pyx'],
        library_dirs=[CUDA['lib64']],
        libraries=['cudart'],
        language='c++',
        runtime_library_dirs=[CUDA['lib64']],
        # this syntax is specific to this build system
        # we're only going to use certain compiler args with nvcc and not with
        # gcc the implementation of this trick is in customize_compiler() below extra_compile_args={'gcc': ["-Wno-unused-function"],
        'nvcc': ['-arch=sm_35','--ptxas-options=-v','-c','--compiler-options',"'-fPIC'"]},
include_dirs = [numpy_include, CUDA['include']]
),

setup.py修改完成后,执行make

编译caffe(项目自带的caffe-fast-rcnn)
具体安装方法,详见我的另一篇博客,地址:http://blog.csdn.net/zhang_shuai12/article/details/52289825
注意执行完make, 别

  • 2
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 36
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值