A couple of things:

What exactly is happening inside loader_epoch?
I was wondering if these lines can be moved inside full_data_epoch function.




 sidwa0:

encoder = RNNModel(len(src_vocab.stoi), 300, 512, 0.5)
decoder = RNNModel(len(trg_vocab.stoi), 300, 512, 0.5, 0.5, "batch")
encoder = encoder.to(device)
decoder = decoder.to(device)

loss_func = torch.nn.CrossEntropyLoss()
enc_optim = torch.optim.Adam(encoder.parameters(), lr=1e-4)
dec_optim = torch.optim.Adam(decoder.parameters(), lr=1e-4)



The things that could have gone wrong:

The vocab size for one of the files is too large to fit in memory.
The model is dynamically modified during training which becomes to large to fit in memory.