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

Conv1d: Expected 2D (unbatched) or 3D (batched) input to conv1d #2

Open
shuaih97 opened this issue Jun 7, 2023 · 2 comments
Open

Comments

@shuaih97
Copy link

shuaih97 commented Jun 7, 2023

What version of Pytorch you were using for this code? I use 1.12.1+cu113, but there was an error:
Traceback (most recent call last):
File "main.py", line 33, in
executor.train(train_data, valid_data)
File "/work/users/s/h/shuaishu/Transformer/STFGNN-Pytorch/STFGNN/executor/multi_step_executor.py", line 82, in train
output = self.model(trainx)
File "/work/users/s/h/shuaishu/.conda/STFGNNpy37pytorch/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/work/users/s/h/shuaishu/Transformer/STFGNN-Pytorch/STFGNN/model/STFGNN.py", line 416, in forward
x = model(x, self.mask)
File "/work/users/s/h/shuaishu/.conda/STFGNNpy37pytorch/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/work/users/s/h/shuaishu/Transformer/STFGNN-Pytorch/STFGNN/model/STFGNN.py", line 204, in forward
data_left = torch.sigmoid(self.conv1(data_temp))
File "/work/users/s/h/shuaishu/.conda/STFGNNpy37pytorch/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/work/users/s/h/shuaishu/.conda/STFGNNpy37pytorch/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 307, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/work/users/s/h/shuaishu/.conda/STFGNNpy37pytorch/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 304, in _conv_forward
self.padding, self.dilation, self.groups)
RuntimeError: Expected 2D (unbatched) or 3D (batched) input to conv1d, but got input of size: [64, 64, 358, 12]

I have searched on the Internet about this issue and it is probably due to the version of Pytorch. For 1.12.1+cu113 I use, I need to modify to Conv2d, with the same parameters. Do they do the same things? If so, I will not downgrade my Pytorch version. But I still want to know what version you were using. Thank you so much!

@zhi-jiao
Copy link

The same problem

@wkq-wukaiqi
Copy link

nnzhan/Graph-WaveNet#34

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

3 participants