【发布时间】:2019-04-12 06:12:50
【问题描述】:
我正在尝试将softmax activation layer 应用于Add() 层的输出。我正在尝试将此层作为模型的输出,但遇到了一些问题。
似乎Add() 层不允许使用激活,如果我这样做:
predictions = Add()([x,y])
predictions = softmax(predictions)
model = Model(inputs = model.input, outputs = predictions)
我明白了:
ValueError: Output tensors to a Model must be the output of a Keras `Layer` (thus holding past layer metadata). Found: Tensor("Softmax:0", shape=(?, 6), dtype=float32)
【问题讨论】:
标签: python-3.x keras deep-learning