这给了我一个错误,告诉我它预期3维但得到2:
input_layer =输入(shape =(None,1000000))
lstm_1 = LSTM(500, dropout=.2, recurrent_dropout=.2)(input_layer)
这些中的任何一个都给了我一个错误,告诉我它预期有4个维度但得到3个:
input_layer = Input(shape=(None, 1000000, None))
input_layer = Input(shape=(None, None, 1000000))
输入shape
参数没有考虑批量大小,所以真正给shape=(None, 1000)
期待(batch_size, None, 100)
它变成3维。因此,您需要提供形状数据(样本,时间步长,特征),因此fit
函数的3D数据输入。