Data Galore

Share this post
All about Google Colab
datagalore.substack.com

All about Google Colab

Data Galore
Apr 21, 2020
Share this post
All about Google Colab
datagalore.substack.com

Image Source: https://towardsdatascience.com/the-2-step-guide-to-upload-images-in-google-colab-b51348e882e4

What is Google Colaboratory?

Colaboratory allows users to execute Python code through a browser. This is favorable for Machine Learning and Data Science enthusiasts. The best part of Google Colab is that it provides free access to heavy computing resources such as GPUs & TPUs. Google Colab is a free to use tool.

What are the usage Limits of Google Colab?

Google Colab follows the concept of dynamic usage limit allocation. This fluctuates in response to the demand from users across the globe. The allocation of GPU and TPU resources are favored to users who use Colab interactively compared to the ones running long notebooks.

Notebooks can be run on Colab as long as 12 hours at a stretch, however the idle time behavior may vary over time based on dynamic resource allocation. The resource allocation in Google Colab is favored to the users who use less resources compared to the ones who hog them. So be wise and mindful using Colab :)

How to create your first Google Colab Notebook?

Step 1: Open your Google Drive and create a new folder:-

Step 2: Open the created folder -> Right Click -> Colaboratory

Step 3: Create a Notebook and change Theme

The Hardware Accelerator gives you options to choose between GPU/TPU

How to change Theme

Navigate to Settings -> Site -> dark

What are the different Hardware Accelerators in Google Colab?

Tensor Processing Unit (TPU)

Graphics Processing Unit (GPU)

When to use different Hardware Accelerators?

GPU should be used when dealing with large models. GPUs should be used when TPUs are not available. TPUs are used when performing complicated calculations on extremely large models which takes about weeks or even months to train.

Time & Validation Time on MNIST dataset[60000 Training images] (GPU vs TPU) comparison

GPU -> 82.6214 seconds

TPU -> 1465.9391 seconds

Although the Google Colab TPU is supposed to be much faster than GPUs, the TPU in our Notebook seems to be as slow as the CPU. Something seems terribly wrong. Comment if you have explanations for the same.

Sample Colab Notebooks

TPU Notebook:

https://drive.google.com/open?id=10LsS-_4Rt_xHoEaR8eJox5CPpESpqn6N

GPU Notebook:

https://drive.google.com/open?id=1T0T0vtzzDJHcFrm7VPz0yNYPuM3FUTjN

Feel free to subscribe for similar posts.

Happy Reading :)

Share this post
All about Google Colab
datagalore.substack.com
Comments

Create your profile

0 subscriptions will be displayed on your profile (edit)

Skip for now

Only paid subscribers can comment on this post

Already a paid subscriber? Sign in

Check your email

For your security, we need to re-authenticate you.

Click the link we sent to , or click here to sign in.

TopNewCommunity

No posts

Ready for more?

© 2022 Data Galore
Privacy ∙ Terms ∙ Collection notice
Publish on Substack Get the app
Substack is the home for great writing