Skip to content

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

Description

@leon-cas

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions