benedekrozemberczki/CapsGNN

运行代码就报错?都没修改

lmqhello opened this issue · 3 comments

Traceback (most recent call last):
File "src/main.py", line 19, in
main()
File "src/main.py", line 14, in main
model.fit()
File "/lmq/CapsGNN/src/capsgnn.py", line 293, in fit
prediction, reconstruction_loss = self.model(data)
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/lmq/CapsGNN/src/capsgnn.py", line 147, in forward
first_capsule_output = self.first_capsule(hidden_representations)
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/lmq/CapsGNN/src/layers.py", line 86, in forward
u = [self.unitsi for i in range(self.num_units)]
File "/lmq/CapsGNN/src/layers.py", line 86, in
u = [self.unitsi for i in range(self.num_units)]
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 313, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/usr/local/miniconda3/lib/python3.8/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: [1, 2, 20, 15]

layer 文件有个conv1d 改为conv2d 我倒是发现loss两轮之后就一直为nan 还要调一下,坑死

请问您解决这个错误了吗,求方案

layer 文件有个conv1d 改为conv2d 我倒是发现loss两轮之后就一直为nan 还要调一下,坑死

请问您是怎么修改的呀,可以分享一下不