janericlenssen / group_equivariant_capsules_pytorch

Pytorch implementation of Group Equivariant Capsule Networks
29 stars 8 forks source link

a little question about Pseudo-Coordinates #4

Open WMF1997 opened 5 years ago

WMF1997 commented 5 years ago

Hello @mrjel : I cloned your code to my cpu-only computer. I follow the instructions in your readme.md. when I run the mnist example, I got a RuntimeError. Here is the error:

  warnings.warn('We do not recommend using the non-optimized CPU '
Traceback (most recent call last):
  File "examples/mnist.py", line 202, in <module>
    train(epoch)
  File "examples/mnist.py", line 140, in train
    f_out, a_out, _, img_out = model(img_batch.to(device))
  File "/home/wmf997/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "examples/mnist.py", line 71, in forward
    x = F.relu(self.conv1(x, be1, bp1, pose))
  File "/home/wmf997/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/wmf997/anaconda3/lib/python3.7/site-packages/group_capsules/nn/modules/group_conv_layer.py", line 58, in forward
    f_out = self.convs[0](x, edge_index, p).squeeze(-1)
  File "/home/wmf997/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/wmf997/anaconda3/lib/python3.7/site-packages/torch_geometric/nn/conv/spline_conv.py", line 114, in forward
    min_pseudo, max_pseudo))

RuntimeError: Pseudo-coordinates must lay in the fixed interval [0, 1] but found them in the interval [-5.960464477539063e-08, 1.0]

The negative part's absolute value is quite small, but it is NOT 0. ... I do not know where to fix it.

Yours, @wmf1997

WMF1997 commented 5 years ago

P.S. I use PyTorch 1.1.0, PyTorch Geometric is 1.3.0 (newest), PyTorch Unique is the newest.