1. 程式人生 > >【Caffe】Python版本Faster R-CNN+ZF程式碼執行

【Caffe】Python版本Faster R-CNN+ZF程式碼執行

相關參考部落格:

下面是我自己在跑python版本Faster R-CNN程式碼ZF模型的流程:

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

2.進入py-faster-rcnn/lib  make

3.將make.config檔案複製到py-faster-config/caffe-fast-rcnn中

4.在py-faster-config/caffe-fast-rcnn下

    make all

    make test (可不要)

    make runtest (可不要)

    make pycaffe

5.複製資料集VOCdevkit2007及與訓練模型imagenet_modelst到py-faster-rcnn/data下

   或者 cd py-faster-rcnn下:  ./data/scripts/fetch_faster_rcnn_models.sh

6.在py-faster-rcnn/lib/fast-rcnn/train.py中增加/py-faster-rcnn/caffe-fast-rcnn/python的絕對路徑:

7.更改迭代次數

   在py-faster-rcnn/tools/train_faster_rcnn_alt_opt.py中更改(這裡我將原來的迭代次數縮小了100倍):


8.可能會出現記憶體溢位的問題,需要py-faster-rcnn/lib/faster-rcnn/config.py中的圖片大小,論文中將最短邊縮放到600 pixels,一般電腦吃不消,可以改為450 pixels,對應MAX_SIZE改為750,如下:


9.開始訓練

在py-faster-rcnn下執行  ./experiments/scripts/faster_rcnn_alt_opt.sh 0 ZF pascal_voc