Written by Nick088. Redone by Julia
Colab Workarounds
Table of Contents
- Runtime disconnected due to inactivity
a. PC Method
b. Mobile Method - Cannot connect to GPU backend
- Disallowed code
Runtime disconnected due to inactivity
- Happens when you remain AFK (not interacting with the space) for a long time.
- Depending on the device, the workaround differs.
PC Method
- Run the necessary cells.
- When you wish to go AFK, in Colab open Inspect Element by pressing Ctrl + Shift + I. (for Mac, Command + Option + C)
- Click the gear on the top right corner.

- Go to Experiments. In Filter type "pasting", and untick
Show warning about Self-XSS when pasting code.

-
Back in Inspect Element, go to the Console tab, paste the following & press Enter key:
function ClickConnect(){
console.log("Working");
document.querySelector("colab-toolbar-button#connect").click()
}
setInterval(ClickConnect,60000)
- It'll look something like this:

Mobile Method
- Download the browser Kiwi.
- Execute all the necessary cells.
- When you wish to go AFK, open Developer tools.

- Follow step 3 onwards of the PC Method.
Cannot connect to GPU backend
- This happens when you run out of the daily GPU usage time of Colab.
- You can connect without GPU, but remember that it's slower & you'll need it for training models/using W-Okada.
Solutions
- Wait 12 - 24 hours for it to reset.
- Buy a Colab Subscription.
-
Use CPU Runtime for tasks that don’t need GPU, to save GPU Runtime.

Disallowed code
- It triggers when the Colab runs code that's restricted for free tier users. See them all in their FAQ.
- The Colab you're running may be outdated too, as new Colabs have found ways to bypass this, using a Link Shortener or Encrypting the code in Rot 13.