You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ValueError: MessagePassing.propagate only supports torch.LongTensor of shape [2, num_messages] or torch_sparse.SparseTensor for argument edge_index.
#53
Closed
TianyuFan0504 opened this issue
Jul 24, 2022
· 1 comment
Hi! Thanks for the amazing work and released code. They are really interesting.
When I run ./transferLearning_MoleculeNet_PPI/chem/pretrain_graphcl.py, the error occur.
When I print it, i got the value of edge_index, but it is a str "add" instead of a tensor. Can someone help me?
Traceback (most recent call last):
File "pretrain_graphcl.py", line 185, in
main()
File "pretrain_graphcl.py", line 176, in main
train_acc, train_loss = train(args, model, device, dataset, optimizer)
File "pretrain_graphcl.py", line 103, in train
x1 = model.forward_cl(batch1.x, batch1.edge_index, batch1.edge_attr, batch1.batch)
File "pretrain_graphcl.py", line 61, in forward_cl
x = self.gnn(x, edge_index, edge_attr)
File "/opt/anaconda3/envs/torch170/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/GSSL/Molecular/GraphCL/transferLearning_MoleculeNet_PPI/chem/model.py", line 277, in forward
h = self.gnns[layer](h_list[layer], edge_index, edge_attr)
File "/opt/anaconda3/envs/torch170/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/GSSL/Molecular/GraphCL/transferLearning_MoleculeNet_PPI/chem/model.py", line 55, in forward
return self.propagate(self.aggr, edge_index, x=x, edge_attr=edge_embeddings)
File "/opt/anaconda3/envs/torch170/lib/python3.7/site-packages/torch_geometric/nn/conv/message_passing.py", line 272, in propagate
size = self.check_input(edge_index, size)
File "/opt/anaconda3/envs/torch170/lib/python3.7/site-packages/torch_geometric/nn/conv/message_passing.py", line 158, in check_input
('MessagePassing.propagate only supports torch.LongTensor of '
ValueError: MessagePassing.propagate only supports torch.LongTensor of shape [2, num_messages] or torch_sparse.SparseTensor for argument edge_index.
The text was updated successfully, but these errors were encountered:
Hi! Thanks for the amazing work and released code. They are really interesting.
When I run ./transferLearning_MoleculeNet_PPI/chem/pretrain_graphcl.py, the error occur.
When I print it, i got the value of edge_index, but it is a str "add" instead of a tensor. Can someone help me?
Traceback (most recent call last):
File "pretrain_graphcl.py", line 185, in
main()
File "pretrain_graphcl.py", line 176, in main
train_acc, train_loss = train(args, model, device, dataset, optimizer)
File "pretrain_graphcl.py", line 103, in train
x1 = model.forward_cl(batch1.x, batch1.edge_index, batch1.edge_attr, batch1.batch)
File "pretrain_graphcl.py", line 61, in forward_cl
x = self.gnn(x, edge_index, edge_attr)
File "/opt/anaconda3/envs/torch170/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/GSSL/Molecular/GraphCL/transferLearning_MoleculeNet_PPI/chem/model.py", line 277, in forward
h = self.gnns[layer](h_list[layer], edge_index, edge_attr)
File "/opt/anaconda3/envs/torch170/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/GSSL/Molecular/GraphCL/transferLearning_MoleculeNet_PPI/chem/model.py", line 55, in forward
return self.propagate(self.aggr, edge_index, x=x, edge_attr=edge_embeddings)
File "/opt/anaconda3/envs/torch170/lib/python3.7/site-packages/torch_geometric/nn/conv/message_passing.py", line 272, in propagate
size = self.check_input(edge_index, size)
File "/opt/anaconda3/envs/torch170/lib/python3.7/site-packages/torch_geometric/nn/conv/message_passing.py", line 158, in check_input
('
MessagePassing.propagate
only supportstorch.LongTensor
of 'ValueError:
MessagePassing.propagate
only supportstorch.LongTensor
of shape[2, num_messages]
ortorch_sparse.SparseTensor
for argumentedge_index
.The text was updated successfully, but these errors were encountered: