Traceback (most recent call last):



 "train.py", line 271, in <module>

main()


 "train.py", line 268, in main

train(transformer, training_data, validation_data, crit, optimizer, opt)


 "train.py", line 126, in train

train_loss, train_accu = train_epoch(model, training_data, crit, optimizer)


 "train.py", line 73, in train_epoch

return total_loss/n_total_words, n_total_correct/n_total_words
RuntimeError: Expected object of type torch.cuda.FloatTensor but found type torch.cuda.LongTensor for argument #2 'other'

Traceback (most recent call last):


 "train_variational_autoencoder_pytorch.py", line 233, in <module>

valid_elbo, valid_log_p_x = evaluate(cfg.n_samples, model, variational, valid_data)


 "train_variational_autoencoder_pytorch.py", line 173, in evaluate

elbo = log_p_x_and_z - log_q_z
RuntimeError: The size of tensor a (128) must match the size of tensor b (512) at non-singleton dimension 1
