Google Colab

What is Google Colab?

Mudit Arora
3 min readNov 30, 2018

Google colab is a google internal research tool for data science for some time. They have released out the tool sometime earlier to the general public with a noble goal of dissemination of machine learning education and research. Although it’s been for quite a while there is a new feature that will interest a lot of people.

Getting Google Colab Ready to Use

  1. Go to https://colab.research.google.com/ and signup.
  2. Once you get the access, you can upload notebooks using File->Upload Notebook.

Setting Free GPU

  1. just follow Edit > Notebook settings or Runtime>Change runtime type and select GPU as Hardware accelerator.
  2. Now we can start using Google Colab. (Running basic Python codes)
  3. To cross-check whether the GPU is enabled you can run the first cell in the shared notebook.

Installing some basic libraries

Pytorch

As the default environment doesn’t have Pytorch, We have to install this ourselves. So don’t delete the cells.

http://download.pytorch.org/whl/{accelerator}/torch-0.3.0.post4-{platform}-linux_x86_64.whl

Fastai

It is also necessary to install. We’ll use pip to install. https://docs.fast.ai/

Keras

It is used in GPU. Use pip to install. https://pypi.org/project/Keras/

MxNet

OpenCV

GraphicViz

7-Zip Reader

https://www.7-zip.org/download.html

There are other libraries too by !pip install or !apt-get install

Writing and Running codes

  1. There are many sample codes in Google Colab also, you can check that too if you want. Else, write your own codes.
  2. After writing codes, Run the code.

Processing

  1. Sometimes, errors comes in connecting with GPU runtime, it sometimes throws an error saying it can’t connect. That’s due to the heavy number of people trying to use the service Vs the number of GPU machines.
  2. But don’t forget to save your code in Google Drive by making a folder of your name, and try again re connecting.

Conclusion

I think Colab will bring a new breath to Deep Learning and AI studies all over the world.

This task was completed as a part of Google Code-in 2018.

Google Code-in is a contest to introduce pre-university students (ages 13–17) to open source software development. Since 2010, over 3200 students from 99 countries have completed work in the contest.

View Contest: https://codein.withgoogle.com/

Sustainable Computing Research Lab (SCoRe) @ Google Code-In : https://codein.withgoogle.com/organizations/sustainable-computing-research-lab-score/

--

--