1. 程式人生 > >ubuntu16+caffe fast-rcnnCPU執行步驟

ubuntu16+caffe fast-rcnnCPU執行步驟

1.首先opencv是需要安裝的,我用的ubuntu14.04,opencv3.0,具體安裝教程可以參考網上很多,不想多提。

 

2.安裝幾個依賴包:cython,python-opencv和easydict,直接用sudo apt-get安裝,網上很多用pip安裝,bug比較多。

 

3.從github上clone專案檔案,注意:一定要在clone時加入--recursive引數,不然會很麻煩,也不要直接下載:

 

git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git 

 

 

4.Cython模組的編譯

cd py-faster-rcnn/lib

make

 

5.編譯caffe-fast-rcnn

cd ..

cd caffe-fast-rcnn

 

修改這個目錄下的Makefile.config(如果沒有這個檔案,就直接cp Makefile.config.example Makefile.config)

將CPU_ONLY := 1開關和WITH_PYTHON_LAYER開關開啟:

image

image

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial