Thanks a lot. I did the following. Changed model.train(False) to model.eval(), changed the addition operation to torch.add() and used loss.data to add loss of each minibatch.
Will use torch.no_grad() too but I right now have older version of PyTorch. Will update it(though it’s working without it).
Can you stress more on :
and training and evaluating at the same time feels strange for me
Isn’t it a good practice to calculate validation loss after each training epoch?