py-faster-rcnn配置

参考:http://bealin.github.io/2016/10/23/Caffe%E5%AD%A6%E4%B9%A0%E7%B3%BB%E5%88%97%E2%80%94%E2%80%946%E4%BD%BF%E7%94%A8Faster-RCNN%E8%BF%9B%E8%A1%8C%E7%9B%AE%E6%A0%87%E6%A3%80%E6%B5%8B/

http://blog.csdn.net/u011635764/article/details/52831167

http://blog.csdn.net/u012283902/article/details/63255301

http://www.cnblogs.com/dudumiaomiao/p/6555898.html


1. 安装配置文件

    sudo apt-get install python-numpy python-scipy python-matplotlib python-sklearn python-skimage    python-h5py python-protobuf python-leveldb python-networkx python-     nose python-pandas python-gflags Cython ipython python-yaml

    sudo pip install easydict

2.  下载py-faster-rcnn

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


3. Cython模块编译

    cd py-faster-rcnn/lib

    sudo make


4. 修改 py-faster-rcnn/lib/setup.py

      'nvcc': ['-arch=sm_50',

     修改 GPU的 sm值,修改为自己的GPU的值,我的GPU为GTX745,sm值为50


5. caffe 和 pycaffe的编译

    cd py-faster-rcnn/caffe-fast-rcnn

    cp Makefile.config.example  Makefile.config

   按照自己的环境修改Makefile.config

    我没有使用cudnn,要用python,因此只将 WITH_PYTHON_LAYER := 1前的#去掉

   若要使用cudnn  请参考http://blog.csdn.net/u011635764/article/details/52831167

    再修改一个include错误

    将py-faster-rcnn/caffe-fast-rcnn/src/caffe/test/test_smooth_L1_loss_layer.cpp中的#include“caffe/vision_layers.hpp"删除

    sudo mkdir build

    cd build

    sudo cmake ..

    sudo make all

    sudo  make test

    sudo make runtest

    sudo make pycaffe


6. 下载训练好的模型

    打开py-faster-rcnn/data/scripe/fetch_faster_rcnn_models.sh  复制里面的路径在https://mm.ww.rrjs.pw/中下载

   将文件保存在py-faster-rcnn/data中

   或者直接用命令下载

   cd py-faster-rcnn

   sudo sh ./data/scripe/fetch_faster_rcnn_models.sh


7.  运行demo

    cd py-faster-rcnn

    sudo python2.7 ./tools/demo.py


8. 结果

  



9.  如若遇到问题

     参考: 

      http://blog.csdn.net/u012283902/article/details/63255301

      http://www.cnblogs.com/dudumiaomiao/p/6555898.html

     问题:

     Check failed: error == cudaSuccess (2 vs. 0) out of memory

     解决:

     修改文件/lib/fast_rcnn/config.py

      # Minibatch size (number of regions of interest [ROIs])
      __C.TRAIN.BATCH_SIZE = 128    #将此值改小,2的幂次,64 ,32, 16 ..

  
      # Each scale is the pixel size of an image's shortest side
      __C.TRAIN.SCALES = (600,)   # 改小 500,400,300,...

      可改一处后运行,看是否可以,也可改两处。

          





    

      

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值