py-R-FCN安装

1.下载py-R-FCN

git clone https://github.com/Orpine/py-R-FCN.git

 

2.下载caffe

cd $RFCN_ROOT  
git clone https://github.com/Microsoft/caffe.git

 

3.替换cudnn

由于cudnn版本问题,所以重新拷贝(家目录):

cp caffe/include/caffe/util/cudnn.hpp py-R-FCN/caffe/include/caffe/util/cudnn.hpp 
 
cp caffe/src/caffe/layers/cudnn_* py-R-FCN/caffe/src/caffe/layers/

cp caffe/include/caffe/layers/cudnn_* py-R-FCN/caffe/include/caffe/layers/

 

4. lib目录下编译

cd /home/user/py-R-FCN/lib

make

 

5.编译caffe和pycaffe

拷贝自己的Makefile.config,注释掉Makefile.config目录下的Anaconda的部分,编译:

cd $RFCN_ROOT/caffe  

make -j8 && make pycaffe

 

6.测试demo

需要下载resnet50_rfcn_final.caffemodel和resnet101_rfcn_final.caffemodel。

放在RFCN_ROOT/data/rfcn_models/路径下。

直接运行demo会报错:

Demo for data/demo/000456.jpg
Detection took 0.069s for 300 object proposals
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Available platform plugins are: minimal, offscreen, xcb.

Reinstalling the application may fix this problem.
Aborted (core dumped)

所以先注释掉环境变量中的Anaconda。

运行demo会报错:

Traceback (most recent call last):
  File "./tools/demo_rfcn.py", line 17, in <module>
    from fast_rcnn.config import cfg
  File "/home/user/py-R-FCN/tools/../lib/fast_rcnn/config.py", line 23, in <module>
    from easydict import EasyDict as edict
ImportError: No module named easydict

安装easydict:

pip install easydict

 运行demo:

./tools/demo_rfcn.py --net ResNet-50 

 成功。

posted @ 2018-01-04 21:14  peiyuYang  阅读(1558)  评论(4编辑  收藏  举报