Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to close and halt a jupyter notebook on google Colab

If I am done with a jupyter notebook created on google colab and which was connected to one of its env with GPU, how do I close and halt it? Locally, I used to do this by clicking on File > Close and Halt. I just want to be considerate about using this great and free computing resource.

like image 957
kawingkelvin Avatar asked Apr 28 '18 19:04

kawingkelvin


People also ask

How do you pause execution in Colab?

Run the following cell and select Runtime -> Interrupt execution (hotkey: Cmd/Ctrl-M I) to stop execution.

Can I close colab while running?

If you close the notebook window and open it while the instance is still running, the cell outputs and variables will still persist. However if the notebook instance has been recycled, your cell outputs and variables will no longer be available.

How do I restart and clear output in Colab?

To clear outputs, go to 'EDIT' and 'clear all outputs'. If you want to reset all packages, data files etc. installed, you have got to the runtime as you mentioned.

How do you collapse a cell in Google Colab?

After setting up the text part in Colab like what others have said, you can press control and quote key at the same time and collapse whichever cell/section you want.


3 Answers

Just close the tab, we'll take care of the rest.

like image 90
Craig Citro Avatar answered Oct 21 '22 09:10

Craig Citro


I recently found that

  1. Menu > Runtime > Factory reset runtime actually terminate and decommission the VM releasing it back.

It will be faster than waiting for the system to reclaim it. This is handy if you are overusing your quota and want your "clock" to reset as soon as possible.

like image 24
kawingkelvin Avatar answered Oct 21 '22 07:10

kawingkelvin


Go to:

Runtime >> Manage sessions

There you can view the active sessions

You can Terminate sessions or Terminate other sessions than the current Colab notebook

like image 45
Bibin Avatar answered Oct 21 '22 08:10

Bibin