【问题标题】:what is output dimension of the inception and vgg16inception和vgg16的输出维度是多少
【发布时间】:2019-11-21 01:25:21
【问题描述】:

我使用了两个图像网络训练模型,即 VGG16 和使用 Keras API 在 python 中使用以下行的 inception;其中 x 是输入图像,批量大小为简单起见 =1。

VGGbase_model = InceptionV3(weights='imagenet', include_top=False, 
input_shape=(299,299,3))
Inceptionbase_model = VGG16(weights='imagenet', include_top=False, 
input_shape=(224,224,3))
predictVgg16= VGGbase_model.predict_on_batch(x)
predictinception= Inceptionbase_model.predict_on_batch(x)

我观察到 VGG16 模型预测的输出维度为 (1,512) ,我知道 512 是 VGG16 预测的特征。然而,初始模型输出的维度为 1,8,8,2048。我知道 2048 是 inception 预测的特征向量,但什么是 8,8 以及为什么 VGG16 只有二维而 inception 有 3。请提供任何 cmets。

【问题讨论】:

    标签: image-processing keras deep-learning conv-neural-network vgg-net


    【解决方案1】:

    您只需键入以下内容即可查看所有图层大小:

    print(Inceptionbase_model.summary())
    print(VGGbase_model.summary())
    

    你们可以在这里看到: InceptionV3, vgg16

    InceptionV3 在最后一个卷积层具有形状 (None,8,8,2048)vgg16 (None, 7, 7, 512)。如果您想从每个模型中获取特征,您可以通过使用 include_top=Falsepooling='avg'pooling='max' 调用模型来实现(这将在末尾添加一个池化层,并将为 InceptionV3 模型输出 2048 个特征vgg16 则为 512。

    例如

    img_shape=(299,299,3)
    Inceptionbase_model = InceptionV3(input_shape=img_shape, weights='imagenet', include_top=False, pooling='avg')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-08-30
      • 1970-01-01
      • 2014-07-22
      • 2018-02-21
      • 2021-10-04
      • 2020-11-02
      • 2012-10-24
      相关资源
      最近更新 更多