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

IndexError: "index out of range in self" in training on custom dataset #37

Open
leon-cas opened this issue Nov 2, 2021 · 1 comment

Comments

@leon-cas
Copy link

leon-cas commented Nov 2, 2021

i, I was trying to use HGTConv on a custom graph with 5 different nodes, but I kept on running into an error IndexError: index out of range in self when node_type only has target node.

Error messages:
node_type = tensor([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1..., 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1])
node_type.shape = (129,)
edge_index = tensor([[ 0, 1, 14, 3, 4, 5, 6, 7,...82, 184, 188, 189, 189,
190, 190, 192]])
edge_index.shape = (2, 353)

IndexError: index out of range in self
When calling: self.propagate(edge_index, node_inp=node_inp, node_type=node_type,
edge_type=edge_type, edge_time = edge_time)
Call ended by exception
meta_xs = gc(meta_xs, node_type_id, edge_index, edge_type, edge_time)
IndexError: index out of range in self
When calling: gc(meta_xs, node_type_id, edge_index, edge_type, edge_time)
Call ended by exception

I was looking at pyg-team/pytorch_geometric#2073 where suggestion "remove cached=True argument from the GCNConv layer can solve the index error.

and pyg-team/pytorch_geometric#1631: set add_self_loops=False in GATConv(..., add_self_loops=False), but no such argument in HGTConv.

@rickyqiao
Copy link

Hello leon-cas. I also encounter this problem when I use HGTConv. Had you solved this problem?

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