benedekrozemberczki / pytorch_geometric_temporal

PyTorch Geometric Temporal: Spatiotemporal Signal Processing with Neural Machine Learning Models (CIKM 2021)
MIT License
2.61k stars 367 forks source link

Wrong number of argument in MPNNLSTM example #225

Closed JavaStudentAlex closed 1 year ago

JavaStudentAlex commented 1 year ago

I am using the 0.54 version of the pytorch geometric temporal. When I try to run the examples/recurrent/mpnnlstm_example.py file the model class code fails:

class RecurrentGCN(torch.nn.Module):
    def __init__(self, node_features):
        super(RecurrentGCN, self).__init__()
        self.recurrent = MPNNLSTM(node_features, 32, 32, 20, 1, 0.5)
        self.linear = torch.nn.Linear(2*32 + node_features, 1)

    def forward(self, x, edge_index, edge_weight):
        h = self.recurrent(x, edge_index, edge_weight)
        h = F.relu(h)
        h = self.linear(h)
        return 

The error is:

TypeError: MPNNLSTM.__init__() takes 6 positional arguments but 7 were given

As far as I can judge the init arguments in this class are:

def __init__(
        self,
        in_channels: int,
        hidden_size: int,
        num_nodes: int,
        window: int,
        dropout: float,
    ):

One of the arguments is extra.