Written by Nick088. Redone by Julia


Colab Workarounds


Table of Contents
  1. Runtime disconnected due to inactivity
    a. PC Method
    b. Mobile Method
  2. Cannot connect to GPU backend
  3. Disallowed code

Runtime disconnected due to inactivity

a

  • Happens when you remain AFK (not interacting with the space) for a long time.
  • Depending on the device, the workaround differs.

PC Method

  1. Run the necessary cells.

  1. When you wish to go AFK, in Colab open Inspect Element by pressing Ctrl + Shift + I. (for Mac, Command + Option + C)

  1. Click the gear on the top right corner.


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


  1. 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


  1. Download the browser Kiwi.

  1. Execute all the necessary cells.

  1. When you wish to go AFK, open Developer tools.


  1. 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

  1. Wait 12 - 24 hours for it to reset.
  2. Buy a Colab Subscription.
  3. Use CPU Runtime for tasks that don’t need GPU, to save GPU Runtime.

    image


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.

Edit

Pub: 26 Feb 2024 19:25 UTC

Edit: 28 Feb 2024 03:56 UTC

Views: 6194