Solved by albanD in post #5 
              
              
                Hi, 
You can easily check the previous code by running it I guess. 
For the new code, you want to make sure you don’t store too much Tensors that would fill up your memory. 
Also be careful to use with torch.no_grad(): when evaluating your model to reduce memory usage.