Graph_Convolutional_LSTM icon indicating copy to clipboard operation
Graph_Convolutional_LSTM copied to clipboard

Missing import?

Open LaurentBerder opened this issue 2 years ago • 0 comments

Hi,

I'm trying out your code to gain a better understanding of the whole concept, but I get an error:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-21-5955e675779a> in <module>
     2 back_length = 3
     3 Clamp_A = False
----> 4 gclstm = GraphConvolutionalLSTM(K, torch.Tensor(A), FFR[back_length], A.shape[0], Clamp_A=Clamp_A, output_last = True)
     5 gclstm, gclstm_loss = TrainModel(gclstm, train_dataloader, valid_dataloader, num_epochs = 1)
     6 gclstm_test = TestModel(gclstm, test_dataloader, max_speed )

<ipython-input-17-b87e6355c7f7> in __init__(self, K, A, FFR, feature_size, Clamp_A, output_last)
    28
    29         # a length adjustable Module List for hosting all graph convolutions
---> 30         self.gc_list = nn.ModuleList([FilterLinear(feature_size, feature_size, self.A_list[i], bias=False) for i in range(K)])
    31
    32         hidden_size = self.feature_size

<ipython-input-17-b87e6355c7f7> in <listcomp>(.0)
    28
    29         # a length adjustable Module List for hosting all graph convolutions
---> 30         self.gc_list = nn.ModuleList([FilterLinear(feature_size, feature_size, self.A_list[i], bias=False) for i in range(K)])
    31
    32         hidden_size = self.feature_size

NameError: name 'FilterLinear' is not defined

FilterLinear is not something you defined, and it's not something you import either. Do you remember where it comes from?

Obviously, since it's been a while since you posted your code I am not running the same version of PyTorch (1.12.1+cu116 instead of 0.42), but it doesn't seem like it's an import as you're not doing any import star.

LaurentBerder avatar Apr 13 '23 06:04 LaurentBerder