Melmaphother / TimeDART

This is the official PyTorch implementation of the paper: Diffusion Auto-regressive Transformer for Effective Self-supervised Time Series Forecasting.
22 stars 0 forks source link

error occurred while finetuning #1

Open YuyangQian opened 2 days ago

YuyangQian commented 2 days ago

Hi, this model is a great work, but i met a problem. I followed the instructions in readme, and here is what ocurred when executing sh scripts/finetune/ETTh2.sh

start training : finetune_TimeDART_ETTh2_M_il336_ll48_pl96_dm8_df32_nh8_el2_dl1_fc1_dp0.4_hdp0.1_ep10_bs16_lr0.0001>>>>>>>>>>>>>>>>>>>>>>>>>> <class 'numpy.ndarray'> (8640, 7) train 8209 513 <class 'numpy.ndarray'> (3216, 7) val 2785 174 <class 'numpy.ndarray'> (3216, 7) test 2785 2785 Training: 0%| | 0/513 [00:00<?, ?it/s]C urrent learning rate: 0.0000040 Training: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 513/513 [00:13<00:00, 37.15it/s] . . . █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2785/2785 [00:08<00:00, 339.77it/s] Epoch: 10, Steps: 513, Time: 26.58s | Train Loss: 0.4172925 Vali Loss: 0.2198206 Test Loss: 0.2786267 EarlyStopping counter: 3 out of 3 Early stopping testing : finetune_TimeDART_ETTh2_M_il336_ll48_pl96_dm8_df32_nh8_el2_dl1_fc1_dp0.4_hdp0.1_ep10_bs16_lr0.0001<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <class 'numpy.ndarray'> (3216, 7) test 2785 2785 Traceback (most recent call last): File "run.py", line 264, in main() File "run.py", line 260, in main exp.test() File "S:\Pycharm\projects\TimeDART-main\exp\exp_timedart.py", line 369, in test preds = preds.reshape(-1, preds.shape[-2], preds.shape[-1]) IndexError: tuple index out of range

Should I change the parameter --features M to --features MS

Melmaphother commented 2 days ago

Thank you for your attention to our work.

Regarding your question, if I understood correctly, it seems that an error occurs during the final testing after fine-tuning:

preds = preds.reshape(-1, preds.shape[-2], preds.shape[-1])
IndexError: tuple index out of range

When I tested it locally, the output at this point looked like this, which you might find helpful as a reference:

TimeDART-issue-1

You could check if any part of the code was modified. If you haven’t made any changes, you can print out the shape of preds and examine the details to pinpoint where the issue might be.

YuyangQian commented 2 days ago

I changed the code in exp_timedart.py, line: 362

preds.append(pred) -> preds.append(pred.numpy()) trues.append(true) -> trues.append(true.numpy())

And it works. Thanks for your reply!