zezhishao / STEP

Code for our SIGKDD'22 paper Pre-training-Enhanced Spatial-Temporal Graph Neural Network For Multivariate Time Series Forecasting.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error

moghadas76 opened this issue · comments

RuntimeError: Expected 2D (unbatched) or 3D (batched) input to conv1d, but got input of size: [32, 32, 325, 13]

For detailed error stacktrace:

-- Process 1 terminated with the following error:
Traceback (most recent call last):
File "/home/seyed/miniconda3/lib/python3.10/site-packages/torch/multiprocessing/spawn.py", line 69, in _wrap
fn(i, *args)
File "/home/seyed/miniconda3/lib/python3.10/site-packages/easytorch/launcher/dist_wrap.py", line 43, in dist_func
func(*args, **kwargs)
File "/home/seyed/miniconda3/lib/python3.10/site-packages/easytorch/launcher/launcher.py", line 35, in training_func
raise e
File "/home/seyed/miniconda3/lib/python3.10/site-packages/easytorch/launcher/launcher.py", line 31, in training_func
runner.train(cfg)
File "/home/seyed/miniconda3/lib/python3.10/site-packages/easytorch/core/runner.py", line 339, in train
loss = self.train_iters(epoch, iter_index, data)
File "/home/seyed/PycharmProjects/step/STEP/basicts/runners/base_tsf_runner.py", line 238, in train_iters
forward_return = list(self.forward(data=data, epoch=epoch, iter_num=iter_num, train=True))
File "/home/seyed/PycharmProjects/step/STEP/step/step_runner/step_runner.py", line 66, in forward
prediction, pred_adj, prior_adj, gsl_coefficient = self.model(history_data=history_data, long_history_data=long_history_data, future_data=None, batch_seen=iter_num, epoch=epoch)
File "/home/seyed/miniconda3/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/seyed/miniconda3/lib/python3.10/site-packages/torch/nn/parallel/distributed.py", line 1156, in forward
output = self._run_ddp_forward(*inputs, **kwargs)
File "/home/seyed/miniconda3/lib/python3.10/site-packages/torch/nn/parallel/distributed.py", line 1110, in _run_ddp_forward
return module_to_run(*inputs[0], **kwargs[0]) # type: ignore[index]
File "/home/seyed/miniconda3/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/seyed/PycharmProjects/step/STEP/step/step_arch/step.py", line 65, in forward
y_hat = self.backend(short_term_history, hidden_states=hidden_states, sampled_adj=sampled_adj).transpose(1, 2)
File "/home/seyed/miniconda3/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/seyed/PycharmProjects/step/STEP/step/step_arch/graphwavenet/model.py", line 187, in forward
gate = self.gate_convsi
File "/home/seyed/miniconda3/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/seyed/miniconda3/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 313, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/home/seyed/miniconda3/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 309, in _conv_forward
return F.conv1d(input, weight, bias, self.stride,
RuntimeError: Expected 2D (unbatched) or 3D (batched) input to conv1d, but got input of size: [32, 32, 325, 13]

commented

See issues #26 and #20 .

Thanks...It works but results were not aligned with paper:))

2023-08-30 23:57:12,295 - easytorch-training - INFO - Evaluate best model on test data for horizon 1, Test MAE: 2.1541, Test RMSE: 3.7392, Test MAPE: 0.0512
2023-08-30 23:57:12,297 - easytorch-training - INFO - Evaluate best model on test data for horizon 2, Test MAE: 2.4308, Test RMSE: 4.4956, Test MAPE: 0.0602
2023-08-30 23:57:12,298 - easytorch-training - INFO - Evaluate best model on test data for horizon 3, Test MAE: 2.6174, Test RMSE: 5.0146, Test MAPE: 0.0671
2023-08-30 23:57:12,300 - easytorch-training - INFO - Evaluate best model on test data for horizon 4, Test MAE: 2.7649, Test RMSE: 5.4362, Test MAPE: 0.0728
2023-08-30 23:57:12,302 - easytorch-training - INFO - Evaluate best model on test data for horizon 5, Test MAE: 2.8880, Test RMSE: 5.7751, Test MAPE: 0.0776
2023-08-30 23:57:12,303 - easytorch-training - INFO - Evaluate best model on test data for horizon 6, Test MAE: 2.9913, Test RMSE: 6.0560, Test MAPE: 0.0814
2023-08-30 23:57:12,305 - easytorch-training - INFO - Evaluate best model on test data for horizon 7, Test MAE: 3.0787, Test RMSE: 6.2909, Test MAPE: 0.0848
2023-08-30 23:57:12,307 - easytorch-training - INFO - Evaluate best model on test data for horizon 8, Test MAE: 3.1546, Test RMSE: 6.4865, Test MAPE: 0.0878
2023-08-30 23:57:12,308 - easytorch-training - INFO - Evaluate best model on test data for horizon 9, Test MAE: 3.2239, Test RMSE: 6.6651, Test MAPE: 0.0908
2023-08-30 23:57:12,310 - easytorch-training - INFO - Evaluate best model on test data for horizon 10, Test MAE: 3.2826, Test RMSE: 6.8043, Test MAPE: 0.0932
2023-08-30 23:57:12,311 - easytorch-training - INFO - Evaluate best model on test data for horizon 11, Test MAE: 3.3380, Test RMSE: 6.9331, Test MAPE: 0.0957
2023-08-30 23:57:12,313 - easytorch-training - INFO - Evaluate best model on test data for horizon 12, Test MAE: 3.3912, Test RMSE: 7.0482, Test MAPE: 0.0978
2023-08-30 23:57:12,362 - easytorch-training - INFO - Result : [test_time: 49.30 (s), test_MAE: 2.9430, test_RMSE: 5.9794, test_MAPE: 0.0800]

commented

It looks very close, is this the result of the best epoch, or the last epoch?

It does not matter. Thanks for being supportive

commented

👀