正在查找keras inceptionresnetv2的图层名称

2024-09-29 23:33:05 发布

您现在位置:Python中文网/ 问答频道 /正文

真的不知道我在做什么,按照本教程处理deepdream图像https://www.youtube.com/watch?v=Wkh72OKmcKI

正在尝试从此处将基本模型数据集更改为任意,https://keras.io/api/applications/#models-for-image-classification-with-weights-trained-on-imagenet特别是当前的InceptionResNetV2。InceptionV3使用“mixed0”到“mixed10”,而之前的数据集显然使用了不同的命名系统

必须改变这一部分

# Maximize the activations of these layers
names = ['mixed3', 'mixed5']
layers = [base_model.get_layer(name).output for name in names]

# Create the feature extraction model
dream_model = tf.keras.Model(inputs=base_model.input, outputs=layers)

我收到一个错误“没有这样的层:mixed3”

所以,是的,只是想弄清楚如何获得这个数据集中的层以及其他层的名称


Tags: the数据namehttps图像forbasemodel
1条回答
网友
1楼 · 发布于 2024-09-29 23:33:05

您只需输入以下代码即可找到模型体系结构(包括层名称)

#Model denotes the Inception model
model.summary()

或者想象复杂的关系

tf.keras.utils.plot_model(model, to_file='model.png')

相关问题 更多 >

    热门问题