faster-rcnn(testing): ubuntu14.04+caffe+cuda7.5+cudnn5.1.3+opencv3.0+matlabR2014a環境搭建記錄

python版本的faster-rcnn見個人另外一篇博客:html

py-faster-rcnn(running the demo): ubuntu14.04+caffe+cuda7.5+cudnn5.1.3+python2.7環境搭建記錄python

 

1. 首先須要配置編譯caffe的環境,並降級gcc爲4.7.見: ubuntu14.04下安裝cudnn5.1.3,opencv3.0,編譯caffe及matlab和python接口過程記錄(很差意思,這也是我本身寫的)git

2. clone 源碼:github

 

git clone --recursive https://github.com/ShaoqingRen/faster_rcnn

 

3. clone 做者的caffe源碼(記住必定要是做者的,否則運行matlab程序時會出錯,我想這個道理應該很明白).不過這一步應該在上面的recursive clone作到了.ubuntu

4. 在做者提供的百度雲連接上下載訓練好的模型,固然也能夠"Run fetch_data/fetch_faster_rcnn_final_model.m to download our trained models",不過速度會很慢.
python2.7

5. 進入faster_rcnn/external/caffe,複製一份以前編譯caffe時的Makefile.config,也能夠複製當前文件夾下的Makefile.config.example,去掉.example後綴.post

cd external/caffe

6. 修改Makefile.config文件,加入matlab路徑.個人.config文件重要部分以下:fetch

 

#USE_CUDNN := 1
 OPENCV_VERSION := 3
CUDA_DIR := /usr/local/cuda
BLAS := atlas
 MATLAB_DIR := /usr/local/MATLAB/R2014a
ANACONDA_HOME := $(HOME)/anaconda2
PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
         $(ANACONDA_HOME)/include/python2.7 \
         $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \
PYTHON_LIB := $(ANACONDA_HOME)/lib
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib


 USE_PKG_CONFIG := 1

 值得注意的是這裏好像用不到cudnn,用了反而會報錯,試了各類辦法都不行。。。
ui

 

 

7 開始編譯caffe和matlab接口spa

 

make clean
make -j8
make matcaffe

 

8 按照做者提供的testing步驟跑demo:

  1. Run faster_rcnn_build.m
  2. Run startup.m
  3. Run experiments/script_faster_rcnn_demo.m to test a single demo image.

 

 9 到此,算是功德圓滿.大體結果以下:

相關文章
相關標籤/搜索