Yolo_v1 本地运行实验TensorFlow
Yolo_v1 原理学习
参考 https://zhuanlan.zhihu.com/p/46691043 进行
Yolo_v1 实验
参考:https://github.com/TowardsNorth/yolo_v1_tensorflow_guiyu
环境及数据集准备
TensorFlow 2.x环境
数据集 VOCtrainval_06-Nov-2007.tar:https://hyper.ai/datasets/7660
权重文件 YOLO_small:链接:https://pan.baidu.com/s/1tMeCBj2OItaIBJbotNFUDA 提取码:k6tp
解压数据集和权重文件,存放位置如下所示
Modify configuration in yolo/config.py
采用默认,不修改
编译运行
问题:‘module ‘tensorflow’ has no attribute 'contrib’
原因:这是由于TensorFlow2.x去掉了contrib模块
解决:https://github.com/tensorflow/models/issues/8020 安装tf_slim模块
pip install git+https://github.com/adrianc-a/tf-slim.git@remove_contrib
问题:依然出现部分库在2.0中不存在
解决:使用兼容接口
eg:tf.placeholder,替换为tf.compat.v1.placeholder
问题:from utils.timer import Timer 报错
原因:在文件目录有utils但是默认调用了site-package里的utils
解决:改变自己库的命名
运行结果
参考
https://zhuanlan.zhihu.com/p/46691043