喀拉拉邦密集层的结果

时间:2020-09-30 15:33:14

标签: keras deep-learning layer

print(model.layers[312].output)

输出(无,2048)

第312层代码

Dense(2048, activation='relu',name='first_dense')

样本数量为8732。我需要first_dense层的输出为(8732,2048)。换句话说,所有样本中都需要该层的结果。怎么办??

提前谢谢!

1 个答案:

答案 0 :(得分:1)

您可以创建一个子模型并进行预测

new_model = Model(model.input, model.layers[312].output)
new_model.predict(...)