Colab: programmatically restart runtime and run all notebook cells when cuda runs out of memory?

Viewed 167

Is there a way to programatically catch a cuda out of memory runtime error and then restart and run all? My model can run about 5 runs before cuda runs out of memory and i'm having to manually stop the process and restart & run all cells.

0 Answers
Related