salesforce / CoST

PyTorch code for CoST: Contrastive Learning of Disentangled Seasonal-Trend Representations for Time Series Forecasting (ICLR 2022)
BSD 3-Clause "New" or "Revised" License
214 stars 43 forks source link

A Quick Question #13

Closed mian-lun closed 2 years ago

mian-lun commented 2 years ago

I'm an undergraduate beginner interested in your project, when I try to run your github code, it reports an error that I'm having trouble solving, below are the parameter settings and the details of the error. Sorry for taking up your precious time and I hope you can give me valuable advice on the bug.

Dataset: WTH Arguments: Namespace(alpha=0.0005, archive='forecast_csv', batch_size=8, dataset='WTH', epochs=None, eval=False, gpu=0, iters=None, kernels=None, lr=0.001, max_threads=None, max_train_length=3000, repr_dims=320, run_name='saved_model', save_every=None, seed=None) Traceback (most recent call last): File "C:/Users/免仑/Desktop/CoST-main/train.py", line 101, in verbose=True File "C:\Users\免仑\Desktop\CoST-main\cost.py", line 299, in fit loss = self.cost(x_q, x_k) File "D:\anaconda\envs\fb_prophet\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl return forward_call(*input, *kwargs) File "C:\Users\免仑\Desktop\CoST-main\cost.py", line 145, in forward q_t, q_s = self.encoder_q(x_q) File "D:\anaconda\envs\fb_prophet\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl return forward_call(input, **kwargs) File "C:\Users\免仑\Desktop\CoST-main\models\encoder.py", line 155, in forward rearrange(trend, 'list b t d -> list b t d'), File "D:\anaconda\envs\fb_prophet\lib\site-packages\einops\einops.py", line 422, in rearrange raise TypeError("Rearrange can't be applied to an empty list") TypeError: Rearrange can't be applied to an empty list

Process finished with exit code 1

gorold commented 2 years ago

Hey, thanks for the interest in our work. It looks like you did not specify any arguments for the kernels parameter. You can check out issues #4 and #10.