【python报错】 ValueError: Input 0 is incompatible with layer sequential: expected shape=(None, None, 1), found shape=[None, 1, 3]
ValueError: Input 0 is incompatible with layer sequential: expected shape=(None, None, 1), found...
报错代码:
look_back=3
model.add(LSTM(32,input_shape=(look_back,1),return_sequences=True))
model.fit(trainX,trainY,batch_size=32,epochs=10)#此处报错
原因:input_shape形状不一样
按如下修改即可:
look_back=3
model.add(LSTM(32,input_shape=(1,look_back),return_sequences=True))

相关文章:

猜你喜欢
  • 2022-12-23
  • 2021-04-24
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
相关资源
相似解决方案