lwm412 / STFGNN-Pytorch

A pytorch re-implementation of STFGNN
25 stars 7 forks source link

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

Open shuaih97 opened 1 year ago

shuaih97 commented 1 year ago

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 commented 11 months ago

The same problem

wkq-wukaiqi commented 6 months ago

https://github.com/nnzhan/Graph-WaveNet/issues/34