cnn用于提取特征

时间:2020-08-22 19:08:22

标签: lstm recurrent-neural-network cnn

我希望我的cnn仅提取要进一步传递给lstm进行分类的功能,但不确定在合并后是否需要添加任何其他图层?

input_size = (img_size, img_size, 3)
if model_name == "resnet":
baseModel = ResNet50(
  weights="imagenet",
  include_top=False,
  input_shape=(img_size, img_size, 3)
)

headModel = baseModel.output
headModel = GlobalMaxPooling2D()(headModel)

model = Model(inputs=baseModel.input, outputs=headModel)
model.summary()

对于baseModel.layers中的图层: layer.trainable = True

0 个答案:

没有答案