Colab
YingTing 2018/03/30
Train Machine Learning Models on Google's GPUs for Free
Training model is the most time consuming and expensive part of machine learning. Training model on a GPU can speed up close to 40 times, taking 2 days and turning model into a few hours.
Colab is aimed at being an education and research tool for collaborating on machine learning projects. Colab is completely free forever.
Logging an google account can acess to Colab application.
Colab provide k80 GPU for unlimited accesses of continuous 12 hours.
In other words, you just get disconnected after 12 hours.
Fig.1 Flowchart of using Colab
Fig.1 shows the flowchart of using Colab.
First step to use Colab is going toGoogle Colab, sign into google account.
Fig.2 The homepage of Colab.
Fig.2 shows theColab homepage. Press "Sign in" button on the top-right, and login with google account.
To execute Python program, create a new notebook file by pressing "New Python 2 notebook" or "New Python 3 notebook", or upload a notebook file by pressing "Upload notebook...".
Fig.3 Create or upload a notebook file in Colab
Fig.3 shows how to create a new python notebook by "New Python 2 notebook" or "New Python 3 notebook", or upload another notebook by "Upload notebook".
To set GPU accelerator, chooseRuntime
>Change runtime type
:
Fig.4 Set GPU accelerator by choosing "Runtime" > "Change runtime type"
Fig.4 shows setting GPU accelerator by choosing "Runtime" > "Change runtime type"
Then change the "Hardware accelerator" from "None" to "GPU".
Fig.5 Set hardware accelerator using GPU.
Fig.5 shows changing the hardware accelerator from "None" to "GPU" in notebook settings.
Now the notebook settings in Colab is done.
If some models or other files need to be downloaded via the browser, use python library that Colab provide:
from google.colab import files
files.download("PATH/TO/FILE")
"PATH/TO/FILE" means the website link of the model or the file.
Python 2 或是Python 3
Python 3 是新版的 python 版本,發布於 2008 年底的
Python 2 是舊版的 python,發布於 2000 年底。我們選用 python 3,因為 python 3 已經出來十年,machine learning 也是這十年來快速發展,開發者通常用 python 3 開發。
Ref.
[0] main content