Hi, I just use PyG 1.3.0 and found this problem, I don't know why? So could you please check it? Since the internal code of GCNConv has changed completely as I could not understand somehow...
Traceback (most recent call last):
File "/home/samuel/gaodaiheng/3DFace/pyG/gcn_example.py", line 41, in <module>
x = conv(x, edge_index)
....
File "/home/samuel/anaconda3/envs/pytorch3d/lib/python3.6/site-packages/torch_geometric/utils/scatter.py", line 28, in scatter_
out = op(src, index, 0, None, dim_size, fill_value)
RuntimeError: scatter_add() expected at most 5 argument(s) but received 6 argument(s). Declaration: scatter_add(Tensor src, Tensor index, int dim=-1, Tensor? out=None, int? dim_size=None) -> (Tensor)
import torch
from torch_geometric.data import Data
from torch_geometric.nn import GCNConv
torch.manual_seed(0)
# define edges
edge_index = torch.tensor([[0, 1, 1, 2],
[1, 0, 2, 1]], dtype=torch.long)
# define node feature
x = torch.tensor([[-1,2], [0,4], [1,5]], dtype=torch.float)
# create GCNConv(2, 1)
conv = GCNConv(2, 1)
# forward
x = conv(x, edge_index)
print(x)
When I first run this code, it reminds me to change inv_mask = 1 - mask to inv_mask = ~mask in loop.py/add_remaining_self_loops, after I fixed it, the above problem of scatter_add() rises...
tensor([[2.0028],
[3.1795],
[3.1302]], grad_fn=<AddBackward0>)
I am wondering if this problem raises as I install pytorch-geometric through conda? Thank you very much!
Please update to the latest torch-geometric==1.4.3.
Please update to the latest
torch-geometric==1.4.3.
Thx, bro
Most helpful comment
Please update to the latest
torch-geometric==1.4.3.