question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RuntimeError: Invalid index in scatterAdd

See original GitHub issue

❓ Questions & Help

Hi, I created my own dataset in the way of ‘Cora’ dataset. And my dataset is Data(edge_index=[2, 24729], x=[803, 1], y=[803]). When I tried to run the example/gcn.py using my dataset, I got this error: 捕获 What’s the reason?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rusty1scommented, Apr 15, 2019

I’m not sure what you are trying to achieve. You do not need to save node indices in x, but instead node features. Therefore, x should have shape [num_nodes, num_features], so that each node has num_features features. In your case, x should therefore have size 1004 in the first dimension.

1reaction
rusty1scommented, Apr 14, 2019

You need to either filter out invalid edges in edge_index or add node features to all nodes, e.g., with shape [1004, 1].

Read more comments on GitHub >

github_iconTop Results From Across the Web

RuntimeError: Invalid index in scatterAdd · Issue #207 - GitHub
Questions & Help Hi, I created my own dataset in the way of 'Cora' dataset. And my dataset is Data(edge_index=[2, 24729], x=[803, 1], ......
Read more >
RuntimeError: Invalid index in scatterAdd - PyTorch Forums
Running a basic graph classification algorithm with my own data, most of the code being from here. I get the below issue in...
Read more >
Pytorch RuntimeError: Invalid index in gather - Stack Overflow
This simply means your index tensor c has invalid indices. For example, the following index tensor is valid: x = torch.tensor([ [5, 9,...
Read more >
pytorch 报错RuntimeError: Invalid index in scatter at - CSDN博客
RuntimeError: invalid argument 4: Index tensor must have same size as output tensor apart from the specified dimension at /opt/conda/conda-bld/ ...
Read more >
Scatter Add — pytorch_scatter 1.3.0 documentation
Sums all values from the src tensor into out at the indices specified in the index tensor along a given axis dim ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found