Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: MessagePassing.propagate only supports torch.LongTensor of shape [2, num_messages] or torch_sparse.SparseTensor for argument edge_index. #70

Open
vrjmath opened this issue Jun 11, 2024 · 0 comments

Comments

@vrjmath
Copy link

vrjmath commented Jun 11, 2024

====epoch 1
Iteration: 0%| | 0/38 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/usr/scratch/vshitole6/Summer/pretraingnns/pretraingnns/chem/finetune.py", line 232, in
main()
File "/usr/scratch/vshitole6/Summer/pretraingnns/pretraingnns/chem/finetune.py", line 204, in main
train(args, model, device, train_loader, optimizer)
File "/usr/scratch/vshitole6/Summer/pretraingnns/pretraingnns/chem/finetune.py", line 32, in train
pred = model(batch.x, batch.edge_index, batch.edge_attr, batch.batch)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/scratch/vshitole6/anaconda3/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/scratch/vshitole6/anaconda3/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/scratch/vshitole6/Summer/pretraingnns/pretraingnns/chem/model.py", line 367, in forward
node_representation = self.gnn(x, edge_index, edge_attr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/scratch/vshitole6/anaconda3/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/scratch/vshitole6/anaconda3/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/scratch/vshitole6/Summer/pretraingnns/pretraingnns/chem/model.py", line 268, in forward
h = self.gnns[layer](h_list[layer], edge_index, edge_attr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/scratch/vshitole6/anaconda3/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/scratch/vshitole6/anaconda3/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/scratch/vshitole6/Summer/pretraingnns/pretraingnns/chem/model.py", line 49, in forward
return self.propagate(self.aggr, edge_index, x=x, edge_attr=edge_embeddings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/scratch/vshitole6/anaconda3/lib/python3.11/site-packages/torch_geometric/nn/conv/message_passing.py", line 216, in propagate
size = self.check_input(edge_index, size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/scratch/vshitole6/anaconda3/lib/python3.11/site-packages/torch_geometric/nn/conv/message_passing.py", line 110, in check_input
raise ValueError(
ValueError: MessagePassing.propagate only supports torch.LongTensor of shape [2, num_messages] or torch_sparse.SparseTensor for argument edge_index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant