I’m able to run the code for 600 epochs.
Since the code was running fine before updating some packages, could you create a new virtual environment and install the latest stable PyTorch version there?
The addition of the plotting methods shouldn’t change anything, so it would be interesting to see, which package update might have triggered this issue.
I assume you are not running out of memory, right?