Google Colab Tutorial: How to attach your Google Drive to Google Colab Notebook

Google Colab May 24, 2019

In this Google colab Tutorial we will know how to use Google Colab with Google Drive,With Google Colab, you can build deep learning applications on the GPU (12GB).Now Google Colab is also providing TPU.

This is research project from Google so it is completely free to use.

What is Google Colab?

Google Colab is a free cloud service and now it supports free GPU and TPU! You can:

  • improve your Python programming language coding skills.
  • Play around with different models and codes without worrying about packages and libraries.
  • Develop deep learning applications using popular libraries such as TensorFlow,Keras,, PyTorch, and OpenCV.
  • Most of the libraries are pre-installed others can be installed using simple command
! pip install package_name

Getting Your Data into Google Colab.

Google Colab comes with libraries for accessing various Google services conveniently. It saves your Jupyter Notebook to Google Drive, and you can share the notebooks easily without having to mess around hosting them yourself.

But sometimes we have to work with large Dataset ,Google Colab offers many ways to uplaod your Data into Virtual Machine on which your current instance is running. Whenever your Internet disconnects all the Data is lost and when you reconnect a new Virtual Machine is offered . To avoid Uploading your data every time to Google Colab.

Follow the following steps.

1.   Upload your data into your google drive.

2.   Run Following code in shell.

#Start by connecting gdrive into the google colab
from google.colab import drive

Go to the link mentioned.

3 . Copy the authorization code of your account.

4 . Paste it into the blank space in the output of shell.

5. Now your google drive is available at location /content/gdrive/My Drive/

Keep coding.

sheetala tiwari

I am passionate about Data Science and Machine Learning. I am currently building an AI community on DataDiscuss and we are committed to providing free access to education for everyone.