【问题标题】:Use models from Keras Applications without pretrained weights使用来自 Keras 应用程序的模型,无需预训练权重
【发布时间】:2018-11-13 12:09:58
【问题描述】:

Keras Applications 提供了一些最流行的模型架构的实现,权重在一些最流行的数据集上进行了预训练。这些预定义模型对于迁移学习类似于模型训练的数据集的问题非常方便。

但是,如果我有一个非常不同的问题并想在新数据集上完全训练模型怎么办?如果我没有预训练的权重,如何使用 Applications 中的模型基于我自己的数据集从头开始训练?

【问题讨论】:

    标签: keras deep-learning transfer-learning


    【解决方案1】:

    您可以将 None 分配给 weights 变量,例如使用 inception V3 架构。

    keras.applications.inception_v3.InceptionV3(include_top=False, weights='None', input_shape=input_shape = (img_width, img_height, 3))
    



    include_top=False 将允许您使用自定义网络训练顶层。

    weights='None' 表示我们在没有任何权重的情况下进行训练,如果您想使用 imagenet 权重进行训练,请将其设置为 weights='imagenet'

    【讨论】:

    • 即我使用 include_top=False 将顶层替换为我自己的顶层(基于我的类数)并将权重设置为“无”以从头开始训练完整的模型?
    • 我认为应该是 None 而不是 'None'
    • 它应该是 None 而不是 'None'
    猜你喜欢
    • 1970-01-01
    • 2019-04-10
    • 1970-01-01
    • 2018-07-28
    • 1970-01-01
    • 2019-01-20
    • 1970-01-01
    • 2017-08-19
    • 2018-03-08
    相关资源
    最近更新 更多