Skip to content

RuntimeError: The size of tensor a (542) must match the size of tensor b (30) at non-singleton dimension 1 #238

@LannyCodes

Description

@LannyCodes

1: 0%| | 0/20 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/home/xwj/moment_project/research/forecasting/forecasting_3_autoformer.py", line 1174, in
main()
File "/home/xwj/moment_project/research/forecasting/forecasting_3_autoformer.py", line 1156, in main
checkpoint_path = train_model(args, timestamp)
File "/home/xwj/moment_project/research/forecasting/forecasting_3_autoformer.py", line 805, in train_model
pred_seq = model(x_enc, x_mark_enc, x_dec, x_mark_dec) # [B, pred_len, num_features]
File "/home/xwj/.conda/envs/wind_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/xwj/.conda/envs/wind_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
File "/home/xwj/mnt/src/pre_models/Autoformer/models/Autoformer.py", line 87, in forward
dec_out = self.dec_embedding(seasonal_init, x_mark_dec)
File "/home/xwj/.conda/envs/wind_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/xwj/.conda/envs/wind_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
File "/home/xwj/mnt/src/pre_models/Autoformer/layers/Embed.py", line 154, in forward
x = self.value_embedding(x) + self.temporal_embedding(x_mark)
RuntimeError: The size of tensor a (542) must match the size of tensor b (30) at non-singleton dimension 1
这个问题怎么回事呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions