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:
- Created 4 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 hasnum_features
features. In your case,x
should therefore have size1004
in the first dimension.You need to either filter out invalid edges in
edge_index
or add node features to all nodes, e.g., with shape [1004, 1].