SlideShare a Scribd company logo
‫خدا‬ ‫نام‬ ‫به‬
Google colab
A Classroom presentation on
Cloud Computing at Tarbiat
Modarres University
presentation by:
Ali Sarvary
Ali Alemi
Instructor: Sadegh Dorri N.
Fall 2018 (1397-98)
Contents
 Colab
 Drive
 Connect
 Programming
 Possibilities
What is Google Colab?
 Google Colab is a free cloud service and now it supports free GPU!
 improve your Python programming language coding skills.
 develop deep learning applications using popular libraries such as
Keras, TensorFlow, PyTorch, and OpenCV.
 The most important feature that distinguishes Colab from other free
cloud services is; Colab provides GPU and is totally free.
 Details: https://research.google.com/colaboratory/faq.html
What is Google drive?
 Google Drive is a file storage and synchronization service
developed by Google.
 Google Drive allows users to store files on their servers,
synchronize files across devices, and share files.
 Google Drive offers users with 15 gigabytes of free storage
through Google One.
 Files uploaded can be up to 5 terabytes in size.
Getting Google Colab Ready to Use
 Since Colab is working on your own Google Drive, we first need to
specify the folder we’ll work.
 Of course, you choose the default Colab Notebooks folder instead
of app folder.
Creating New Colab Notebook
 Create a new notebook via Right click > More > Colaboratory
Creating New Colab Notebook
 Rename notebook by means of clicking the file name.
Setting Free GPU
 It is so simple to alter default hardware (CPU to GPU or vice
versa); just follow Edit > Notebook
settings or Runtime>Change runtime type and select
GPU as Hardware accelerator.
Running Basic Python Codes with Google Colab
 Now we can start using Google Colab.
Running or Importing .py Files with Google Colab
 Run these codes first in order to install the necessary libraries and perform
authorization.
from google.colab import drive
drive.mount(‘/content/drive/)
 When you run the code above, you should see a result like this:
 Click the link, copy verification code and paste it to text box.
Running or Importing .py Files with Google Colab
 After completion of the authorization process, you should see this:
 Now you can reach your Google Drive with:
!ls "/content/drive/My Drive/"
Cloning Github Repo to Google Colab
 It is easy to clone a Github repo with Git.
 Step 1: Find the Github Repo and Get “Git” Link
Find any Github repo to use.
Clone or download > Copy the link!
 Step 2: Git Clone
Simply run:
 Step 3. Open the Folder in Google Drive
Folder has the same with the Github repo of course
!git clone https://github.com/wxs/keras-mnist-tutorial.git
Cloning Github Repo to Google Colab
 Step 4. Open The Notebook
Right Click > Open With > Colaboratory
 Step 5. Run
Now you are able to run Github repo in Google Colab.
Is GPU Working?
 To see if you are currently using the GPU in Colab, you can run the
following code in order to cross-check:
import tensorflow as tf
tf.test.gpu_device_name()
Which GPU Am I Using?
from tensorflow.python.client import device_lib
device_lib.list_local_devices()
 Currently, Colab only provides Tesla K80.
Tesla k80
Tesla k80
Tesla k80
How to Restart Google Colab?
In order to restart (or reset) your virtual machine, simply run:
!kill -9 -1
How to Send Large Files From Colab
To Google Drive?
Refrences:
https://colab.research.google.com/notebooks/welcome.ip
ynb#recent=true
https://www.google.com/drive/
https://medium.com/deep-learning-turkey/google-colab-
free-gpu-tutorial-e113627b9f5d
https://github.com/wxs/keras-mnist-tutorial
http://www.snrazavi.ir/google_colab_for_deep_learning/
https://deeplearning.ir/tag/%D8%A2%D9%85%D9%88%D
8%B2%D8%B4-google-colab/
https://mh-salari.me/google-colab/
http://blog.class.vision

More Related Content

Introduction to using google colab

Editor's Notes

  1. Keras : open source library for network Pytorch: open source library for ML Open CV: open source library of intel for function programming به طور پیش‌فرض Tensorflow و بسیاری از کتابخانه‌های دیگر مثل numpy و sklearn و… روی آن نصب شده است و شما میتونید به پیاده‌سازی مدل‌هاتون بپردازید.
  2. Google one:provide100 gigabytes, 200 gigabytes, 2 terabytes, 10 terabytes, 20 terabytes, and 30 terabytes
  3. App folder in drive
  4. به راحتی میتونید در کولب دستورهای مختلف از جمله pip , apt-get, ls, cd, و… را اجرا کنید. فقط کافی است قبل از دستور مورد نظرتون علامت !‌ رو قرار بدهید.