Shisho_Sama:

imagenet_train.py:354: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead. input_var = torch.autograd.Variable(input, volatile=True)


Pay attention to this. volatile now does nothing, and you should wrap your validate loop in with torch.no_grad():.
Your graph in validate won’t be freed until the output and loss variables are overwritten in the next iteration, and thus effective doubling memory usage.