来自post。我知道我可以使用input_shape =(1,)而不是input_dim = 1。但是当我运行代码时出现错误ValueError: Input 0 is incompatible with layer lstm_24: expected ndim=3, found ndim=2
。我是否理解正确?
model = Sequential()
model.add(LSTM(50,
input_dim=1,
return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(
100,
return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(
100,
return_sequences=False))
model.add(Dropout(0.2))
model.add(Dense(1))
model.add(Activation('linear'))