我目前正在尝试可视化 Keras 1.0 中中间层的输出(我可以使用 Keras 0.3 实现),但它不再起作用了。
x = model.input
y = model.layers[3].output
f = theano.function([x], y)
但我收到以下错误:
MissingInputError: ("An input of the graph, used to compute DimShuffle{x,x,x,x}(keras_learning_phase), was not provided and not given a value.Use the Theano flag exception_verbosity='high',for more information on this error.", keras_learning_phase)
在 Keras 1.0 之前,使用我的图形模型,我可以这样做:
x = graph.inputs['input'].input
y = graph.nodes[layer].get_output(train=False)
f = theano.function([x], y, allow_input_downcast=True)
所以我怀疑它来自“train=False”参数,我不知道如何在新版本中设置。
感谢您的帮助