Layer called with an input that isn't a symbolic tensor keras

风格不统一 提交于 2019-12-03 22:28:59
Aditya Gune

It looks like you're not actually giving an input to your LSTM layer. You specify the number of recurrent neurons and the shape of the input, but do not provide an input. Try:

lstm_out = LSTM(128, input_shape=(maxlen, len(chars)))(net_input)

I know, documentation can be confusing, but Concatenate actually only requires "axis" as parameter, while you passed the layers. The layers need to be passed as argument to the result of it as follow:

Line to modify:

x = keras.layers.concatenate([book_out, char_out])

How it should be:

x = keras.layers.Concatenate()([book_out, char_out])

I think you need to add axis=1 to concatenate, Try:

x = keras.layers.concatenate([book_out, char_out], axis=1)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!