practical-pytorch
practical-pytorch copied to clipboard
seq2seq translation issues
-
softmax or log_softmax must have dim parameter, dim=-1 would be OK. (-1 mean the last dimension)
-
criterion (NLLLoss needs 2d as input, so change decoder_output[0] to decoder_output would be OK.
-
time_since has divide zero error, change time_since(start, epoch / n_epochs) to time_since(start, epoch * 1.0 / n_epochs * 1.0)
Python 2.7, Torch 0.3.0