我有一个Keras分类网络,最后两层分别是Dense和Activation。我将模型中的图层弹出为:
activationlayer=classifier.layers.pop()
denselayer=classifier.layers.pop()
然后我将图层推回到模型中
outt1=denselayer(classifier.layers[-1].output)
outt=activationlayer(outt1)
classifier=Model(classifier.input,outt)
现在在索引密集层的输出时出现错误:
classifier.layers[-2].output
Error: Layer out2 has multiple inbound nodes, hence the notion of "layer output" is ill-defined.