In this post, we learned about how to set up Google Colab for deep learning. Google Colab is a free help given by Google that permits an individual to run Python note pads without introducing python on their frameworks. Colab furnishes a client with various elements, the most significant of them being:


  • No compelling reason to design for fundamental notebooks
  • Free and simple GPU access
  • Effectively sharing of codes and connecting the notebooks to GitHub
  • Stacking datasets directly from your Google Drive and saving notebooks/prepared models to your drive as well. Google Colab likewise accompanies a Pro component, you can find out about the subtleties of Colab Pro from here. In this post, we will examine setting up your Colab notebooks, to begin with, Machine Learning or Deep Learning advancement.

Installation Dependencies:

While Colab generally comes pre-introduced with the greater part of the essential conditions like Tensor flow, PyTorch, scikit-learn, pandas, and some more, there are chances that you need to introduce outside bundles at a time. Using pip install command you can use.

For example, we can introduce the ttach library, which is utilized for the expansion of pictures during the test stage.

pip introduce library-name

You can also install other libraries as per requirements same as the above installation.

Mounting Google Drive

You can mount your Google Drive utilizing the basic content given below:

After running this you will get a connection that will divert you to choose the record whose Google drive you need to mount. Select the record, acknowledge the authorization solicitation and duplicate the code that shows up on the screen and glue that in the discourse box and press enter. Your Google Drive is presently mounted and you can get to it through the records menu to your left side.

Cloning GitHub Repositories:

Now and again you may have to clone your GitHub repository to your Colab library to chip away at complex ventures that use numerous contents. That should be possible utilizing! git clone connects to-archive. Running the cell would clone the archive to your functioning catalog.

You can likewise clone a repository to your google drive if you have mounted it. That is finished utilizing! git clone connects to-store way to-drive. The example yield would resemble:

Accessing GPU runtime:

The best features of Colab are the free GPU runtime it provides. You can allow your GPU runtime by:

  1. Go to Runtime
  2. Select Change runtime type
  3. Select GPU from the drop-down menu and click on save

You can also check which GPU you are providing using! Nvidia-smi. The output shows GPU memory you are intense and other details as well.

Now you can simply clone GitHub repositories to your drive and execute them using GPU runtime without having to install Python on your local machine.

Sept. 3, 2021
Machine Learning

More from 

Machine Learning


View All

No posts found in this category!