更新时间:2023-12-02 14:22:22
解决@Koul答案.
我相信您不需要使用pop
方法.相反,只需将输出层之前的层作为Model
方法的输出参数的参数传递即可:
I believe you don't need to use the pop
method. Instead just pass the layer before the output layer as the argument for the Model
method's output parameter:
from keras.models import Model
model2 = Model(model.input, model.layers[-2].output)
model2.summary()