Jupyter+pytorch, or cuda memory help: stop notebook mid training

Yes you’ll have to restart the kernel. You may also need to free up space on your GPU. Here’s how:

In terminal run:

nvidia-smi

this let’s you see the processes running on the GPU.

To kill the process(es) type:

sudo kill -9 PID // sudo kill -9 PID

where PID is the process id number.