更新时间:2023-12-02 18:24:52
问题在于输入数据和输入形状之间.
The problem is between your input data and your input shape.
(12,1)
(= batch_shape=(None,12,1)
) X_train_t
具有 (1,64,1)
形状.(12,1)
(= batch_shape=(None,12,1)
) X_train_t
has shape (1,64,1)
. 要么修复模型的输入形状,要么修复数据(如果这不是预期的形状).
Either you fix the input shape of the model, or you fix your data if this is not the expected shape.
对于可变长度/时间步长,您可以使用 input_shape=(None,1)
.
For variable lengths/timesteps, you can use input_shape=(None,1)
.
第二层不需要 input_shape.
You don't need an input_shape in the second layer.