Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do programs continue execution after connection is lost on google-colaboratory?

I am using google-colaboratory to train some convnets on image classification with Keras. And I get often disconnected from the notebook which I've found (on some forums) to be a frequent issue with some colaboratory users. And when I try to reconnect it gets stuck on "initializing":

enter image description here

So I decided to use Keras Checkpoint to save the model I'm training on my google drive, after each epoch.

During the training the notebook disconnected after 2 epochs, but when I monitored my google drive I've observed that models are being saved after each epoch, despite my colaboratory being disconnected.

enter image description here

My guess is that programs continue their execution in the background even if my noteboook is disconnected.

My question is, Am I guessing it right? And what do these disconnections really mean? (Are our variables, etc., preserved)?

like image 713
Alka Avatar asked May 05 '18 22:05

Alka


People also ask

Does Google colab keep running?

In fact, if we leave the notebook idle for more than 30 minutes, Google Colab automatically disconnects it. Every 60 seconds, this function clicks the connect button. As a result, Colab believes that the notebook is not idle, and you should not be concerned about being disconnected!

Can Google colab run offline?

Once you are in your Colab notebook you can use it just like any offline Jupyter notebook.

Does Google colab stay connected when I close my browser?

The current cell will continue executing once you close your browser, but the outputs will not end up in the notebook in Drive.

Does colab save output?

After mounting Google Drive, you can download datasets into Google Drive and use it in Colab session, or save outputs of the session into your Google Drive.


1 Answers

Normally, notebook connection expires after 12 hours and all the data loaded into colab will also be expired with session.

When you run a process and the notebook get disconnected after some time but before 12 hours, the code run in background.

So, if you try to reconnect the notebook, it get stuck on "initializing" until the completion of code execution or session expiry (whichever occurs first). After that, the connection is established again.

like image 57
Waqas Shiekh Avatar answered Oct 06 '22 21:10

Waqas Shiekh