How to reset Colab after the following CUDA error 'Cuda assert fails: device-side assert triggered'?
I'm running my Jupyter Notebook using Pytorch on Google Colab. After I received the 'Cuda assert fails: device-side assert triggered' I am unable to run any other code that uses my pytorch module. Does anyone know how to reset my code so that my Pytorch functions that were working before can still run?

I've already tried implementing CUDA_LAUNCH_BLOCKING=1but my code still doesn't work as the Assert is still triggered!

You need to reset the Colab notebook. To run existing Pytorch modules that used to work before, you have to do the following:


Go to 'Runtime' in the tool bar
Click 'Restart and Run all'


This will reset your CUDA assert and flush out the module so that you can have another shot at avoiding the error!
