系统:win10家庭版
显卡:GTX1660Ti
驱动版本:441.22
cuda版本:10.2.89
cudnn版本:7.6.5.32
tensorflow-gpu版本:1.13.1
opencv-python版本:3.4.2
cython
easydict
matplotlib
scipy
Pillow
参考:https://blog.csdn.net/u013925378/article/details/91046639
参考:https://blog.csdn.net/weixin_43318717/article/details/94433790
链接:https://github.com/dBeker/Faster-RCNN-TensorFlow-Python3
cd C:\Users\SSC\Desktop\Faster-RCNN-TensorFlow-Python3-master
pip install -r requirements.txt
,
Extension( 'lib.utils.cython_bbox',
sources=['../../../lib/utils/bbox.c','../../../lib/utils/bbox.pyx'],
include_dirs = [np.get_include(), '/lib/utils'],
extra_compile_args=[], )
改完之后的setup.py文件如下:
cd C:\Users\SSC\Desktop\Faster-RCNN-TensorFlow-Python3-master\lib\utils
python setup.py build_ext --inplace
生成cython_bbox.c和cython_bbox.pyx,然后将这两个改名为bbox.c和bbox.pyx。
cd C:\Users\SSC\Desktop\Faster-RCNN-TensorFlow-Python3-master\data\coco\PythonAPI
python setup.py build_ext --inplace
python setup.py build_ext install
链接:https://github.com/rbgirshick/py-faster-rcnn#beyond-the-demo-installation-for-training-and-testing-models
VOCtrainval_06-Nov-2007.tar:
http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar
VOCtest_06-Nov-2007.tar:
http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar
VOCdevkit_08-Jun-2007.tar:
http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCdevkit_08-Jun-2007.tar
下载地址:http://download.tensorflow.org/models/vgg_16_2016_08_28.tar.gz
python train.py
之后是漫长的等待,大约七八个小时之后吧。。。
39行:NETS 里面修改为自己训练好的模型文件名
40行:DATASETS 删除 “+ voc_2012_trainval”
108行:default 修改为 vgg16
110行:default 修改为 pascal_voc
python demo.py
结果如下:
...
...
Detection took 3.802s for 300 object proposals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo for data/demo/000457.jpg
Detection took 0.094s for 300 object proposals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo for data/demo/000542.jpg
Detection took 0.094s for 300 object proposals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo for data/demo/001150.jpg
Detection took 0.094s for 300 object proposals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo for data/demo/001763.jpg
Detection took 0.101s for 300 object proposals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo for data/demo/004545.jpg
Detection took 0.109s for 300 object proposals
C:\Users\SSC\Desktop\Faster-RCNN-TensorFlow-Python3-master>