ubuntu14.04配置faster-rcnn
2016-05-13 15:49
405 查看
1 首先要保证安装了cython, python-opencv, easydict,如果没有请执行以下命令:
sudo apt-get install cython
sudo apt-get install python-opencv
sudo pip install easydict
2 Clone the Faster R-CNN repository:
git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git
3 Build the Cython modules:
cd $FRCN_ROOT/lib
make -j16
4 Build Caffe and pycaffe
cd $FRCN_ROOT/caffe-fast-rcnn
cp Makefile.config.example Makefile.config
打开 USE_CUDNN = 1,这个选项默认情况下时关闭的,让CUDA支持DNN(我没做)
打开 WITH_PYTHON_LAYER = 1,这个在默认情况下也是关闭的,FastRCNN需要支持Python接口,因此需要打开
Fast RCNN需要hdf5的支持,这个根据自己的Linux里的库文件安装路径添加,不清楚的可以find一下,不过一般情况下,INCLUDE_DIRS 应该添加上
/usr/include/hdf5/serial LIBRARY_DIRS 添加上 /usr/lib/x86_x64-linux-gnu/hdf5/serial (我没做)
另外把USE_PKG_CONFIG = 1 记得打开,要不然会找不到一些库文件,PKG是linux用来管理库文件
make -j16
make pycaffe -j16
环境配置就结束了,下面就是下载模型进行demo测试
5 Download pre-computed Faster R-CNN detectors
cd $FRCN_ROOT
./data/scripts/fetch_faster_rcnn_models.sh
(可能下载的比较慢,你可以打开data/scripts/fetch_faster_rcnn_models.sh文件,里面有网址,直接去网址下载可能会快一点,顺便将ImageNet models也下载,后面训练要用)
6 To run the demo
cd $FRCN_ROOT
先在demo.py里加入
import sys
sys.path.append('/home/zc/faster-rcnn/py-faster-rcnn/lib')
之后
./tools/demo.py
遇到的报错
sudo apt-get install cython
sudo apt-get install python-opencv
sudo pip install easydict
2 Clone the Faster R-CNN repository:
git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git
3 Build the Cython modules:
cd $FRCN_ROOT/lib
make -j16
4 Build Caffe and pycaffe
cd $FRCN_ROOT/caffe-fast-rcnn
cp Makefile.config.example Makefile.config
打开 USE_CUDNN = 1,这个选项默认情况下时关闭的,让CUDA支持DNN(我没做)
打开 WITH_PYTHON_LAYER = 1,这个在默认情况下也是关闭的,FastRCNN需要支持Python接口,因此需要打开
Fast RCNN需要hdf5的支持,这个根据自己的Linux里的库文件安装路径添加,不清楚的可以find一下,不过一般情况下,INCLUDE_DIRS 应该添加上
/usr/include/hdf5/serial LIBRARY_DIRS 添加上 /usr/lib/x86_x64-linux-gnu/hdf5/serial (我没做)
另外把USE_PKG_CONFIG = 1 记得打开,要不然会找不到一些库文件,PKG是linux用来管理库文件
make -j16
make pycaffe -j16
环境配置就结束了,下面就是下载模型进行demo测试
5 Download pre-computed Faster R-CNN detectors
cd $FRCN_ROOT
./data/scripts/fetch_faster_rcnn_models.sh
(可能下载的比较慢,你可以打开data/scripts/fetch_faster_rcnn_models.sh文件,里面有网址,直接去网址下载可能会快一点,顺便将ImageNet models也下载,后面训练要用)
6 To run the demo
cd $FRCN_ROOT
先在demo.py里加入
import sys
sys.path.append('/home/zc/faster-rcnn/py-faster-rcnn/lib')
之后
./tools/demo.py
遇到的报错
ImportError: cannot import name symbol_database
sudo pip install --upgrade protobuf ImportError: No module named yaml sudo apt-get install Python-yaml
相关文章推荐
- android获取短信验证码并自动填写的实现一
- js函数的可变参数
- linux下实现桥接联网
- mysql 异常解决
- 计算机中RAM和ROM
- 用MVP架构开发Android应用
- 本公子今天开博
- HDU5444 2015长春网络赛H题(dfs遍历二叉树 简单模拟)
- 三种主流Web架构
- 手写体识别
- 隐藏RadioButton, CheckBox的drawable图片 setButtonDrawable
- RMAN备份FORMAT参数说明
- 关于android无线连接的问题
- Base 128 Varints 编码
- 一千个好听的音乐源代码奉上
- 15.4.3 用于Generator的泛型方法
- 《深入浅出Node.js》学习笔记——(三)异步I/O
- 超炫的3D翻转模板
- ACM 数论 兔子的烦恼(二)
- 最长的连续相同字符的字符串和最长连续不相同字符的子字符串问题