Skip to content

GNN-Tutorial-solution  #2

Description

@pjuangph

When I try running the example code with the latest version of pytorch_geometric, I am seeing an error with edge_index and message passing.

Inside GCNConv
` def forward(self, x, edge_index):
# x has shape [N, in_channels]
# edge_index has shape [2, E]

    ########################################################################
    #      START OF YOUR CODE (DO NOT DELETE/MODIFY THIS LINE)             #
    ########################################################################
    # Step 1: Add self-loops to the adjacency matrix.
    
    edge_index = add_self_loops(edge_index, num_nodes=x.size(0))

    # Step 2: Linearly transform node feature matrix.
    x = self.lin(x)

    # Step 3-5: Start propagating messages.

    return self.propagate(edge_index=edge_index, x=x) # Problem occurs here
    ########################################################################
    #                             END OF YOUR CODE                         #
    ########################################################################           `

the base class throws an error: ```
Exception has occurred: TypeError
Required parameter edge_index is empty.


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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