1 Star 0 Fork 0

CoderChong / tensorflow_models_learning

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

tensorflow_models_learning

老铁要是觉得不错,给个“star”

1.生成record训练数据

dataset已经包含了训练和测试的图片,请直接运行create_tf_record.py

对于InceptionNet V1:设置resize_height和resize_width = 224 对于InceptionNet V3:设置resize_height和resize_width = 299 其他模型,请根据输入需要设置resize_height和resize_width的大小

if __name__ == '__main__':
    # 参数设置
    resize_height = 224  # 指定存储图片高度
    resize_width = 224  # 指定存储图片宽度
    shuffle=True
    log=5
    # 产生train.record文件
    image_dir='dataset/train'
    train_labels = 'dataset/train.txt'  # 图片路径
    train_record_output = 'dataset/record/train{}.tfrecords'.format(resize_height)
    create_records(image_dir,train_labels, train_record_output, resize_height, resize_width,shuffle,log)
    train_nums=get_example_nums(train_record_output)
    print("save train example nums={}".format(train_nums))

    # 产生val.record文件
    image_dir='dataset/val'
    val_labels = 'dataset/val.txt'  # 图片路径
    val_record_output = 'dataset/record/val{}.tfrecords'.format(resize_height)
    create_records(image_dir,val_labels, val_record_output, resize_height, resize_width,shuffle,log)
    val_nums=get_example_nums(val_record_output)
    print("save val example nums={}".format(val_nums))

    # 测试显示函数
    # disp_records(train_record_output,resize_height, resize_width)
    batch_test(train_record_output,resize_height, resize_width)

2.训练过程

目前提供VGG、inception_v1、inception_v3、mobilenet_v以及resnet_v1的训练文件,只需要生成tfrecord数据,即可开始训练

训练VGG请直接运行:vgg_train_val.py 训练inception_v1请直接运行:inception_v1_train_val.py 训练inception_v3请直接运行:inception_v3_train_val.py 训练mobilenet_v1请直接运行:mobilenet_train_val.py 其他模型,请参考训练文件进行修改

3.资源下载

  • 本项目详细说明,请参考鄙人博客资料:

《使用自己的数据集训练GoogLenet InceptionNet V1 V2 V3模型》: https://panjinquan.blog.csdn.net/article/details/81560537 《tensorflow实现将ckpt转pb文件》: https://panjinquan.blog.csdn.net/article/details/82218092 《使用自己的数据集训练MobileNet、ResNet实现图像分类(TensorFlow)》https://panjinquan.blog.csdn.net/article/details/88252699 预训练模型下载地址: https://download.csdn.net/download/guyuealian/10610847

  • 老铁要是觉得不错,给个“star”
  • tensorflow-gpu==1.4.0

空文件

简介

深度学习 图像分类 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/CoderChong/tensorflow_models_learning.git
git@gitee.com:CoderChong/tensorflow_models_learning.git
CoderChong
tensorflow_models_learning
tensorflow_models_learning
master

搜索帮助