Hi there, I'm using ogb and just got an error when I run the example GNN code for ogbn-proteins(ogb/examples/nodeproppred/proteins/gnn.py):
File "/Users/qiantao/Mywork/Project/oneID mining/ogb-test/ogb/examples/nodeproppred/proteins/gnn.py", line 74, in train out = model(data.x, data.adj_t)[train_idx]File "/opt/miniconda3/envs/autogl/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs)File "/Users/qiantao/Mywork/Project/oneID mining/ogb-test/ogb/examples/nodeproppred/proteins/gnn.py", line 36, in forward x = conv(x, adj_t)...File "/opt/miniconda3/envs/autogl/lib/python3.9/site-packages/torch/nn/functional.py", line 1847, in linear return torch._C._nn.linear(input, weight, bias)RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x132534 and 1x256)
It seems data.adj_t only contains adjacency information (data.adj_t.to_dense()=[132534, 132534]) and the code fails to aggregate the edge attributes to the nodes.
Referring to MLP.py in the same directory, I modify the code to load the dataset without sparse transformer dataset = PygNodePropPredDataset(name='ogbn-proteins') and generate data.x and data.adj_t based on torch_scatter.scatter and torch_sparse.SparseTensor.
Hi there, I'm using ogb and just got an error when I run the example GNN code for ogbn-proteins(ogb/examples/nodeproppred/proteins/gnn.py):
File "/Users/qiantao/Mywork/Project/oneID mining/ogb-test/ogb/examples/nodeproppred/proteins/gnn.py", line 74, in train out = model(data.x, data.adj_t)[train_idx]
File "/opt/miniconda3/envs/autogl/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs)
File "/Users/qiantao/Mywork/Project/oneID mining/ogb-test/ogb/examples/nodeproppred/proteins/gnn.py", line 36, in forward x = conv(x, adj_t)
...
File "/opt/miniconda3/envs/autogl/lib/python3.9/site-packages/torch/nn/functional.py", line 1847, in linear return torch._C._nn.linear(input, weight, bias)
RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x132534 and 1x256)
It seems
data.adj_t
only contains adjacency information (data.adj_t.to_dense()=[132534, 132534]
) and the code fails to aggregate the edge attributes to the nodes. Referring to MLP.py in the same directory, I modify the code to load the dataset without sparse transformerdataset = PygNodePropPredDataset(name='ogbn-proteins')
and generatedata.x
anddata.adj_t
based ontorch_scatter.scatter
andtorch_sparse.SparseTensor
.Hope this helps!