1. 程式人生 > >win7下配置faster-rcnn的tensorflow版本(gpu版本)

win7下配置faster-rcnn的tensorflow版本(gpu版本)

首先給出原始碼網址:https://github.com/dBeker/Faster-RCNN-TensorFlow-Python3.5

所需的軟體環境:python3.5+tensorflow-gpu1.40(gpu版本)+vs2015+pycharm+cuda8.0+cudnn6.1

cuda8.0下載地址:https://developer.nvidia.com/cuda-80-ga2-download-archive

cudnn6.1下載地址:https://developer.nvidia.com/cudnn

cuda8.0和cudnn很好安裝,安裝自行百度教程安裝即可。

python3.5下載地址:https://www.python.org/downloads/release/python-352/

python的其他庫安裝(用pip3即可):

cython, python-opencv, easydict......


tensorflow安裝方法:

tensorflow-gpu1.40下載地址:https://pypi.python.org/pypi/tensorflow-gpu/1.4.0

安裝方法和python安裝其他庫的方法相同,即在命令列下使用pip3

faster-rcnn安裝方法:

1.  Go to ./data/coco/PythonAPI

      Run python setup.py build_ext --inplace

      Run python setup.py build_ext install

      環境配置完畢

2. 下載資料集

       下載地址:

http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar
http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar
http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCdevkit_08-Jun-2007.tar

        下載之後放在:

        "data/VOCDevkit2007/annotations_cache"

        "data/VOCDevkit2007/VOC2007"

3. 下載預訓練好的vgg16網路或者其他網路

        下載地址:https://github.com/tensorflow/models/tree/master/research/slim#pre-trained-models


        將下載好的模型放在:$faster-rcnn目錄$\data\imagenet_weights下面

4. 訓練模型

        執行 train.py程式即可,一般用cpu跑迭代一次需要20s,用gpu跑一次迭代需要2-3s

        每經過5000次迭代,會儲存網路相關檔案,儲存的資訊在:$faster-rcnn目錄$\default\voc_2007_trainval\default

5. 執行demo.py

        將步驟4中儲存的檔案放在   下面,執行demo.py便會出現結果