环境:
- 硬件:i5 cpu 4G内存,GTX 1050Ti 4G显存
- 软件环境:win10+anaconda下python3。
代码来源及教程:https://github.com/dBeker/Faster-RCNN-TensorFlow-Python3
踩坑总结:
-
配置tensorflow环境下载很慢,使用国内源:
pip install XXX -i https://pypi.tuna.tsinghua.edu.cn/simple
XXX为要安装的包,尝试过一次性添加的方法,但是好像没用,然后就每次安装包的时候在后面加上:
-i https://pypi.tuna.tsinghua.edu.cn/simple 好使!
其他源:
http://mirrors.aliyun.com/pypi/simple/
https://pypi.mirrors.ustc.edu.cn/simple/
http://pypi.mirrors.ustc.edu.cn/simple/
https://pypi.douban.com/simple -
tensorflow-gpu、cuda、cudnn、以及python的版本一定要对应,我用的分别对应是1.10.0 、9.0 、7 、3.6 ,参考:https://www.jianshu.com/p/464fefb5c5d8 由于错误没有记下就不贴了。
-
按照教程配置好后运行提示:No model named"pycocotools“
- 首先检查使用的anaconda环境下是否安装了"pycocotools,anaconda prompt 命令行运行:conda list 可以查看。
- 没有则安装pycocotools,在这之前还得先安装git 和visual studio build tools (如果已经按照了vs之类的,在安装visual studio build tools的时候会提示要先把vs卸载,但其实不用,进入window自带的卸载功能的地方,选择vs修改,从新选择需要的工具包,比如相关的SDK,其实我也不确定需要补安装哪些包,把看着相关的都补装了,后面运行没问题)
- 安装git这里我踩了个大坑,下载了window版的git就像安装普通window软件的方式安装的,然而并不好使。
而是用conda install git -
然后再执行:pip install git+https://github.com/philferriere/cocoapi.git#egg=pycocotools^&subdirectory=PythonAPI,问题解决
-
Failed to find any matching files for./data/imagenet_weights/vgg16.. :把解压后的vgg_16.ckpt文件则重命名为vgg16.ckpt.
-
再训练完,运行demo.py的时候,报错:OSError: output\res101\voc_2007_trainval+voc_2012_trainval\default\res101_faster_rcnn_iter_110000.ckpt.meta not found.Did you download the proper networks from our server and place them properly?
因为没有修改获取训练好的.cpkt.mate文件的路径。下下来的代码路劲是不对的(我用的VGG16做bankbone)具体可参考:https://blog.csdn.net/fuyang2191/article/details/80902324