Skip to content

How to run your code #1

@lenhhoxung86

Description

@lenhhoxung86

Hello,
I tried running your code but it was not successful.
python Main.py
Here is the detail error:

Epoch 0/0
----------
Traceback (most recent call last):
  File "Main.py", line 93, in <module>
    rnn, rnn_loss = TrainRNN(train_dataloader, valid_dataloader, num_epochs = 1)
  File "/home/tiendh/Projects/IoT++/Graph_Convolutional_LSTM/Train_Validate.py", line 72, in TrainRNN
    loss_train = loss_MSE(outputs, labels)
  File "/home/tiendh/deeplearning_env/lib/python3.5/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/tiendh/deeplearning_env/lib/python3.5/site-packages/torch/nn/modules/loss.py", line 421, in forward
    return F.mse_loss(input, target, reduction=self.reduction)
  File "/home/tiendh/deeplearning_env/lib/python3.5/site-packages/torch/nn/functional.py", line 1716, in mse_loss
    return _pointwise_loss(lambda a, b: (a - b) ** 2, torch._C._nn.mse_loss, input, target, reduction)
  File "/home/tiendh/deeplearning_env/lib/python3.5/site-packages/torch/nn/functional.py", line 1674, in _pointwise_loss
    return lambd_optimized(input, target, reduction)
RuntimeError: input and target shapes do not match: input [40 x 323], target [40 x 1 x 323] at /pytorch/aten/src/THCUNN/generic/MSECriterion.cu:12

Actually, I had to enable the line train_dataloader, valid_dataloader, test_dataloader, max_speed = PrepareDataset(speed_matrix) to pass the very first error.
Am I doing something wrong? Please guide me how to run your code.

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