【问题标题】:what are the features that are extracted from the last pooling layer of inceptionv3?从 inceptionv3 的最后一个池化层中提取的特征是什么?
【发布时间】:2021-03-22 22:28:17
【问题描述】:

从 inceptionv3 的最后一个池化层中提取的特征是什么?我正在使用 inceptionv3 从衣服中提取特征。我从最后一个池化层中提取了特征,以便在另一个模型中使用它们。

【问题讨论】:

    标签: python-3.x deep-learning neural-network spyder transfer-learning


    【解决方案1】:

    它由形状为8x8的2048个特征图组成。我真的取决于您的输入图像,它们看起来并不完全相同。您可以尝试自己查看它们。例如,这张图片(调整为 300x300 之前):

    将具有类似的功能(2048 个功能中的 8 个):

    这里使用的代码:

    model = tf.keras.applications.InceptionV3(include_top=False,weights='imagenet',input_shape=(300,300,3))
    
    img=cv2.resize(cv2.imread('test2.jpg'),(300,300))
    
    pred=model.predict(np.array([img])/255)[0]
    
    fig, axs = plt.subplots(nrows=2, ncols=4, figsize=(15,6))
    for i, ax in enumerate(axs.flatten()):
        plt.sca(ax)
        plt.imshow(pred[:,:,i], cmap='gray')
    plt.show()
    

    【讨论】:

      猜你喜欢
      • 2018-08-18
      • 1970-01-01
      • 2019-07-31
      • 2017-10-31
      • 1970-01-01
      • 1970-01-01
      • 2018-07-04
      • 2018-08-20
      • 2018-07-26
      相关资源
      最近更新 更多