In the FAQs it is mentioned that
Virtual machines are recycled when idle for a while, and have a maximum lifetime enforced by the system.
Are the maximum lifetime and idle times fixed or variable? Is there any way to predict them?
Colab has implemented a limit on the free usage, so that they can allocate the resources across all users and platforms. Notebooks run by connecting to virtual machines that have maximum lifetimes that can be as much as 12 hours. Notebooks will also disconnect from VMs when left idle for too long.
It's 90 minutes if you close the browser. 12 hours if you keep the browser open. Additionally, if you close your browser with a code cell is running, if that same cell has not finished, when you reopen the browser it will still be running (the current executing cell keeps running even after browser is closed)
PROBLEM: I have to training my model for hours but the google colab keeps disconnecting after 30 mins automatically if I do not click frequently, leading to loss of all data.
SOLUTION:
Steps:
Ctrl+ Shift + i
and then clicking on console tab at top.function ClickConnect(){ console.log("Working"); document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click(); } setInterval(ClickConnect,60000)
Below is the image showing console view of above steps:-
Alternatively you can also try below snippet:
interval = setInterval(function() { console.log("working") var selector = "#top-toolbar > colab-connect-button" document.querySelector(selector).shadowRoot.querySelector("#connect").click() setTimeout(function() { document.querySelector(selector).shadowRoot.querySelector("#connect").click() }, 1000) }, 60*1000)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With