Advertisement

Caffe学习(八)运行py-faster-RCNN

阅读量:

1.下载py-faster-RCNN源码

复制代码
    git clone --recursive https://github.com/rbgirshick/py-faster-rcnn

2.编译lib库

复制代码
    cd $FRCN_ROOT/lib
    make

3.编译caffe

这部分的caffe编译与以前讲述的基本一致,不同的是makefile.config的修改部分,使支持用python定义layer

复制代码
    # In your Makefile.config, make sure to have this line uncommented
    WITH_PYTHON_LAYER := 1

编译caffe与pycaffe

复制代码
    cd $FRCN_ROOT/caffe-fast-rcnn
    # Now follow the Caffe installation instructions here:
    #   http://caffe.berkeleyvision.org/installation.html
    
    # If you're experienced with Caffe and have all of the requirements installed
    # and your Makefile.config in place, then simply do:
    make -j8 && make pycaffe

注意:由于本人所使用的为cuda8.0,py-faster-RCNN所使用的caffe版本比较旧,不支持,编译的时候会出现报错,因此需要对这里的caffe进行更新。

采用以下方式更新新版本caffe

复制代码
    cd caffe-fast-rcnn  
    git remote add caffe https://github.com/BVLC/caffe.git  
    git fetch caffe  
    git merge caffe/master

更新完后删除include/caffe/layers/python_layer.hpp文件里的**self_.attr(“phase”) = static_cast(this- >phase_); **这句话。
更改完后在编译caffe即可

4.下载在VOC-2007上训练好的模型
该模型为在VOC-2007上训练好的VGG16模型

复制代码
    cd $FRCN_ROOT
    ./data/scripts/fetch_faster_rcnn_models.sh

5.运行demo

复制代码
    cd $FRCN_ROOT
    ./tools/demo.py

全部评论 (0)

还没有任何评论哟~