LSTM requires an input of shape [ batch , timesteps , feature ]. Meaning it requires input to have ndim=3 and your X and y` have ndim=2
解决方案
将输入数据调整成三维即可
参考:
1.https://stackoverflow.com/questions/67100929/lstm-valueerror-input-0-of-layer-sequential-is-incompatible-with-the-layer-ex