Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

experiment in traffic.csv #7

Open
Gzlzero opened this issue May 29, 2024 · 1 comment
Open

experiment in traffic.csv #7

Gzlzero opened this issue May 29, 2024 · 1 comment

Comments

@Gzlzero
Copy link

Gzlzero commented May 29, 2024

thanks for you code!I met any problems,when I train the traffic.csv on your model. How to deal with this.

D:\Anaconda3\envs\pytorch\python.exe F:\pythonProject\pathformer-main\run.py
Args in experiment:
Namespace(is_training=1, model='PathFormer', model_id='traffic.sh', data='custom', root_path='./dataset/traffic', data_path='traffic.csv', features='M', target='OT', freq='h', checkpoints='./checkpoints/', seq_len=96, pred_len=96, individual=False, d_model=16, d_ff=64, num_nodes=21, layer_nums=3, k=2, num_experts_list=[4, 4, 4], patch_size_list=[[16, 12, 8, 32], [12, 8, 6, 4], [8, 6, 4, 2]], do_predict=False, revin=1, drop=0.1, embed='timeF', residual_connection=0, metric='mae', num_workers=10, itr=1, train_epochs=20, batch_size=1, patience=5, learning_rate=0.001, lradj='TST', use_amp=False, pct_start=0.4, use_gpu=True, gpu=0, use_multi_gpu=False, devices='2', test_flop=False)
Use GPU: cuda:0

start training : traffic.sh_PathFormer_fttraffic_slM_pl96_96>>>>>>>>>>>>>>>>>>>>>>>>>>
train 12089
val 1661
test 3413
Traceback (most recent call last):
File "F:\pythonProject\pathformer-main\run.py", line 108, in
exp.train(setting)
File "F:\pythonProject\pathformer-main\exp\exp_main.py", line 146, in train
outputs, balance_loss = self.model(batch_x)
^^^^^^^^^^^^^^^^^^^
File "D:\Anaconda3\envs\pytorch\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Anaconda3\envs\pytorch\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\pythonProject\pathformer-main\models\PathFormer.py", line 56, in forward
out, aux_loss = layer(out)
^^^^^^^^^^
File "D:\Anaconda3\envs\pytorch\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Anaconda3\envs\pytorch\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\pythonProject\pathformer-main\layers\AMS.py", line 104, in forward
gates, load = self.noisy_top_k_gating(new_x, self.training)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\pythonProject\pathformer-main\layers\AMS.py", line 74, in noisy_top_k_gating
x = self.start_linear(x).squeeze(-1)
^^^^^^^^^^^^^^^^^^^^
File "D:\Anaconda3\envs\pytorch\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Anaconda3\envs\pytorch\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Anaconda3\envs\pytorch\Lib\site-packages\torch\nn\modules\linear.py", line 116, in forward
return F.linear(input, self.weight, self.bias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: mat1 and mat2 shapes cannot be multiplied (96x862 and 21x1)

@PengChen12
Copy link
Contributor

You should set num_nodes to the number of traffic dataset variables 862

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants