thuml / Autoformer

About Code release for "Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting" (NeurIPS 2021), https://arxiv.org/abs/2106.13008
MIT License
2k stars 429 forks source link

Bug while directly running scripts #107

Closed hchen463 closed 1 year ago

hchen463 commented 1 year ago

Hi,

The following error pops out when I directly run the script. Can you let me know what's going on? Thanks.

Autoformer-main/exp/exp_main.py", line 248, in test preds = preds.reshape(-1, preds.shape[-2], preds.shape[-1]) IndexError: tuple index out of range

ljc20010323 commented 1 year ago

Hi, I also have the same question. Can you let me know how to solve

hchen463 commented 1 year ago

in my example the shape of preds is (90,) cuz the last element in the batch does not share the same size as the previous elements, you can either ignore the last batch or use concat operation to construct preds.