Solved by albanD in post #2 
              
              
                Hi 

Could faulty garbage collection be responsible? 

Python is refcounted. So no issue here  
The usual reason this happens is: 

You accumulate your loss (for later printing) in a differentiable manner like all_loss += loss. This means that all_loss keeps all the history of all the previous itera…