歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> ubuntu14.04配置faster

ubuntu14.04配置faster

日期:2017/3/3 12:51:03   编辑:Linux技術
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 --recursivehttps://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
Copyright © Linux教程網 All Rights Reserved