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

RuntimeError... #39

Closed
lovechang1986 opened this issue Jun 24, 2022 · 2 comments
Closed

RuntimeError... #39

lovechang1986 opened this issue Jun 24, 2022 · 2 comments

Comments

@lovechang1986
Copy link

When I run the main.py using the default msl dataset. Then this error occured.
My torch_geometric version is 2.0.4. Would you help to fix this ?

Traceback (most recent call last):
  File "main.py", line 256, in <module>
    main.run()
  File "main.py", line 108, in run
    self.train_log = train(self.model, model_save_path,
  File "/home/kaifazhe4/test/GDN/train.py", line 69, in train
    out = model(x, edge_index).float().to(device)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/kaifazhe4/test/GDN/models/GDN.py", line 166, in forward
    gcn_out = self.gnn_layers[i](x, batch_gated_edge_index, node_num=node_num*batch_num, embedding=all_embeddings)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/kaifazhe4/test/GDN/models/GDN.py", line 73, in forward
    out, (new_edge_index, att_weight) = self.gnn(x, edge_index, embedding, return_attention_weights=True)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/kaifazhe4/test/GDN/models/graph_layer.py", line 65, in forward
    out = self.propagate(edge_index, x=x, embedding=embedding, edges=edge_index,
  File "/opt/conda/lib/python3.8/site-packages/torch_geometric/nn/conv/message_passing.py", line 317, in propagate
    out = self.message(**msg_kwargs)
  File "/home/kaifazhe4/test/GDN/models/graph_layer.py", line 110, in message
    alpha = softmax(alpha, edge_index_i, size_i)
RuntimeError: softmax() Expected a value of type 'Optional[Tensor]' for argument 'ptr' but instead found type 'int'.
@d-ailin
Copy link
Owner

d-ailin commented Jun 24, 2022

I think it is caused by the inconsistent installed package. There are some solutions provided in the previous issues #2, #20. Hope it helps :)

@lovechang1986
Copy link
Author

Thanks, I checked the older doc of torch_geometric and found the same solution.

Thanks again...

@d-ailin d-ailin closed this as completed Jul 7, 2022
@d-ailin d-ailin mentioned this issue Jul 7, 2022
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

2 participants