我正在尝试嵌入LSTM,并在Keras中包含以下内容:
inp = Input(shape=(20, 1))
x = Embedding(total_words, 256)(inp)
x = LSTM(128)(x)
output = Dense(1, activation ='softmax')(x)
Run Code Online (Sandbox Code Playgroud)
但是,我不明白为什么我总是在行中出现以下错误x = LSTM(128)(x):
ValueError: Input 0 is incompatible with layer lstm_12: expected ndim=3, found ndim=4
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
| 归档时间: |
|
| 查看次数: |
1286 次 |
| 最近记录: |