43

I'm using Google Colab's free version to run my TensorFlow code. After about 12 hours, it gives an error message

"You cannot currently connect to a GPU due to usage limits in Colab."

I tried factory resetting the runtime to use the GPU again but it does not work. Furthermore, I restarted all sessions but this doesn't work either. Is there any method for me to be able to use the GPU again on Google Colab's free version?

Chris
  • 1,206
  • 2
  • 15
  • 35
Mert Ege
  • 551
  • 1
  • 4
  • 5
  • What do you mean by "I applied factory reset runtime to use GPU again but it does not work?" Please provide exact error message and I would be ale to help, cos I have tackled some similar issues in the past. Please be more specific and adding an image is also helpful. – knoop Apr 10 '20 at 03:42
  • 2
    @knoop I mean that I applied "Runtime" ==> "Factory reset runtime" ==> "Yes" on the Google Colab. Fortunately, I can run my code now on GPU backend. I think that I need to wait one day to work again. – Mert Ege Apr 10 '20 at 09:12
  • 6
    I am pretty sure that, either you remained idle for a long time, or worked in the background, while using your GPU instance. Google has a strict policy against these actions and will ban you for a few hours to a few days from using GPU. Also, please try manually terminating the session every time you exit so that other users are not affected and you don't get locked out. – knoop Apr 10 '20 at 12:06

5 Answers5

52

If you use GPU regularly, runtime durations will become shorter and shorter and disconnections more frequent. The cooldown period before you can connect to another GPU will extend from hours to days to weeks. Google tracks everything. They not only know your accounts' usage but also the usage of accounts that appear related to your account and will adjust usage limits accordingly if they even suspect someone of trying to abuse the system. They will never give you an explicit reason why the runtime disconnected or why you can't connect to GPU other than the generic message about "usage limits". Neither will they ever give users a straightforward way to track their usage because all that would do is make it easier for people to skirt the restrictions. If your account is basically blacklisted they will never actually tell you your account is blacklisted because that creates more headaches for them. You'll just get the same message about usage limits when trying to connect forever. They prefer to have users confused and guessing because that keeps all the power with Google. And for a free service, who's to say there's anything wrong with that.

Edit: For Colab Pro they likely won't fatally restrict an account for over-usage but they can significantly restrict it by extending the cooldown period to 3-5 days, reducing runtime durations from 24 hrs to 6-8 hrs, etc. Keep in mind this is for people running multiple accounts multiple times a week for the maximum duration. If you're just using a single account once or twice a week you shouldn't have a problem.

David
  • 5,882
  • 3
  • 33
  • 44
  • 7
    "And for a free service, who's to say there's anything wrong with that." That's how I feel about the users who get free drugs from me! – Michael Tamillow May 01 '21 at 15:11
  • 6
    Anyways, I am in the midst of a school project which I have used Colab to develop in. Google uses all sorts of free software as well, so there is a sort of implied social debt for all the taking they do of the world's data and selling it back out to become one of the biggest companies in the world... – Michael Tamillow May 01 '21 at 15:14
  • 2
    While this _specific_ service doesn't seem to require an upfront cost or any implicit data-based costs, Google stuff are far from free, even when they're listed at $0. It would be impossible to be "really" free. Thing is, people think that this should give them a pass for the _horrendous_ transparency practices when it comes to their product support. I hope this view disappears some day. – Noein May 24 '21 at 04:51
13

Colab's free version works on a dynamic usage limit, which is not fixed and size is not documented anywhere, that is the reason free version is not a guaranteed and unlimited resources.
Basically, the overall usage limits and timeout periods, maximum VM lifetime, GPU types available, and other factors vary over time. Colab does not publish these limits, in part because they can (and sometimes do) vary quickly.

GPUs and TPUs are sometimes prioritized for users who use Colab interactively rather than for long-running computations, or for users who have recently used less resources in Colab. As a result, users who use Colab for long-running computations, or users who have recently used more resources in Colab, are more likely to run into usage limits and have their access to GPUs and TPUs temporarily restricted. Users interested in having higher and more stable usage limits can use Colab Pro.

Ryan M
  • 18,333
  • 31
  • 67
  • 74
10

[THIS IS NOT A FIX BUT A WORKAROUND]

There is no specific way to fix this, I would suggest if you have more than one Google account, to copy your notebook or code to Colab using the other Google account and continue working.

Chris
  • 1,206
  • 2
  • 15
  • 35
Kali Kimanzi
  • 856
  • 7
  • 16
  • 1
    Nice, this actually worked! I though google would keep track of my google accounts and make this not possible, but changing my account aloud me to use the GPU again, thanks – NeStack Nov 09 '21 at 10:55
6

Recently, I have faced the same problem twice. Each time a pop up window appears like this figure that contains the message.

"You cannot currently connect to a GPU due to usage limits in Colab. Learn More"

Don't be disappointed, be relaxed, because it remains effective only for 1 day. You need to wait, and on the next day, you will get full access as previous. The cause of this unexpected message is remaining connected with GPU for a long time without utilizing it (i.e. not running the code that needs GPU). More details, the causes may be one of the followings:

  1. Let's say, you are connected with GPU, then run a code that takes 40 mins to execute. But you leave your laptop and go to sleep for 2, 3 or more hours. Then this unexpected message can appear.
  2. If you don't use GPU but remain connected with GPU, after some time Colab will give you a warning message like Warning: You are connected to a GPU runtime, but not utilising the GPU. Change to a standard runtime. A good practice is to change the runtime on that time, otherwise, you may get blocked on this day.
Rabiul Islam
  • 61
  • 1
  • 3
1

Seems there is no concrete information available.

enter image description here

What are the usage limits of Colab?

What are the usage limits of Colab? Colab is able to provide free resources in part by having dynamic usage limits that sometimes fluctuate, and by not providing guaranteed or unlimited resources. This means that overall usage limits as well as idle timeout periods, maximum VM lifetime, GPU types available, and other factors vary over time. Colab does not publish these limits, in part because they can (and sometimes do) vary quickly.

GPUs and TPUs are sometimes prioritized for users who use Colab interactively rather than for long-running computations, or for users who have recently used less resources in Colab. As a result, users who use Colab for long-running computations, or users who have recently used more resources in Colab, are more likely to run into usage limits and have their access to GPUs and TPUs temporarily restricted. Users with high computational needs may be interested in using Colab’s UI with a local runtime running on their own hardware. Users interested in having higher and more stable usage limits may be interested in Colab Pro.

mon
  • 18,789
  • 22
  • 112
  • 205