Faster-R-CNN(Python).1:从配置到demo
2017-05-04 21:56
471 查看
本文主要讲解Faster-R-CNN(Python)配置过程中遇到的问题。
网传需要用–recursive命令复制源码,否则无法clone到caffe,但是我用的自己的caffe,所以不受影响。
1. 下载源码
Python版本: https://github.com/rbgirshick/py-faster-rcnn网传需要用–recursive命令复制源码,否则无法clone到caffe,但是我用的自己的caffe,所以不受影响。
git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git[/code]2. 安装必要的Python模块
cython, python-opencv, easydictpip install cython pip install easydict conda install opencv (我安装了anaconda)3. Build the Cython modules
cd $FRCN_ROOT/lib make4. 重新编译caffe
我没有用源码中自带的caffe,而是用的自己之前配置的。
版本:
Ubuntu14.04 LTS
cuda8.0
cudnn5.1
OpenCV3.0
Python2.7
但是Faster-R-CNN中有两个新层需要添加
roi_pooling_layer
smooth_L1_loss_layer
将相关文件放入相应文件夹中:
(1)test_roi_pooling_layer.cpp
(2)test_smooth_L1_loss_layer.cpp
(3)roi_pooling_layer.cpp
(4)roi_pooling_layer.cu
(5)smooth_L1_loss_layer.cpp
(6)smooth_L1_loss_layer.cu
(7)fast_rcnn_layers.hpp
添加方法参照下面链接:
https://yunmingzhang.wordpress.com/2015/01/19/how-to-create-your-own-layer-in-deep-learning-framework-caffe/
然后按照官网方法重新编译:
http://caffe.berkeleyvision.org/installation.htmlmkdir build cd build cmake .. make all make install make runtest make pycaffe
done!
遇到的问题:
(1)src/caffe/test/test_smooth_L1_loss_layer.cpp:11:35: fatal error: caffe/vision_layers.hpp
解决方法:
找到文件$CAFFE_ROOT/src/caffe/test/test_smooth_L1_loss_layer.cpp
删除第十一行11 #include "caffe/vision_layers.hpp"
(2) libhdf5_hl.so.10: cannot open shared object file: No such file or directory
解决方法:
添加环境变量并重启计算机vi ~/.bachrc
添加:export LD_LIBRARY_PATH="/path/to/anaconda2/lib":$LD_LIBRARY_PATH
vi文件命令:
‘i’ – Insert,编辑
‘ESC’键 +‘:wq’ –强制保存并退出5. Download pre-computed Faster R-CNN detectors
cd $FRCN_ROOT ./data/scripts/fetch_faster_rcnn_models.sh6. demo
cd $FRCN_ROOT ./tools/demo.py
遇到的问题:
(1) AttributeError: ‘ProposalLayer’ object has no attribute ‘param_str_’
解决方法:
找到对应文件,修改param_str_为param_str
(2) proposal_layer.py出现 keyerror:’1’错误
解决方法:
暴力地将第64行改为cfg_key = ‘TEST’#str(self.phase), demo可以正常运行7.The demo performs detection using a VGG16 network trained for detection on PASCAL VOC 2007.
Bonne chance pour le Faster-R-CNN! ^-^
相关文章推荐
- Faster-RCNN features for instance search(Python)Ubuntu配置
- Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks程序(Python)配置问题总结
- Python Faster R-CNN 安装配置记录
- 深度学习之windows python faster rcnn 配置及demo运行
- 将Faster RCNN的python demo改成C++ demo
- 深度学习之windows python faster rcnn 配置及demo运行
- Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks程序(Python)配置问题总结
- Faster RCNN代码理解(Python)
- faster rcnn修改demo.py保存网络中间结果
- CAFFE- faster rcnn修改demo.py保存网络中间结果
- py-faster-rcnn配置运行faster_rcnn_end2end—VGG_CNN_M_1024(Ubuntu14.04)
- 在Faster R-CNN 中DEMO 的CPU(i5)和GPU(GTX1060 )时间对比
- Windows 配置Faster RCNN matlab版本
- py-faster-rcnn配置运行demo.py(Ubuntu14.04),不成功的朋友请与我(lee)联系,后面附带邮箱
- Faster-RCNN+ZF用自己的数据集训练模型(Python版本)
- faster RCNN python 版安装
- py- faster rcnn修改demo.py
- ubuntu14.04配置faster-rcnn
- Python版Faster-RCNN安装配置
- 【Caffe】Python版本Faster R-CNN+ZF代码运行