Google Colaboratory is a great platform for those who are:
- Looking to create a machine learning model but lack a strong enough CPU/GPU.
- Want the ease and simplicity that comes with a cloud based notebook which requires no setup.
So, What is Google Colaboratory, and Why Should I Use It?
Simply put, Google Colab is a free to use, cloud based version of a Jupyter notebook where the only requirement is a web browser.
Your code is run on a virtual machine hosted by Google, so you don’t need to rely on your PC’s CPU or GPU for any of the heavy lifting, thus making Colab perfect for running intensive machine learning models at no cost.
As the name would suggest, Colab is great for teams to be able to work on scripts simultaneously, as it has the same shared document editing that we are used to from Google Docs.
Notebooks are saved on Google Drive and can be easily revisited for editing or sharing.
A free to use GPU makes Colab a no-brainer; even if not the most powerful around, it makes for a great platform on which to build and develop your machine learning skills.
Colab Hardware Specs
For those curious about just what you get access to, by running the following code in Colab you can query the system specs.
GPU Count and Name:
(Ensure you go to Runtime > Change Runtime Type > GPU)
RAM and HD Space:
Tools for Getting Started
There are a few differences between Colab and a traditional Jupyter notebook. Being cloud based, there are some slight variations on installing packages and importing data.
Installing a package is as easy as prefacing your usual pip command with a !
Importing files to use can be done in one of several ways.
Clone from Github:
Upload a File:
Mount Google Drive:
From there, you can view the contents of your drive by typing :
And with that you have all the tools needed to start your cloud-based ML adventure!
It is important to note that the virtual machine that you run your code on will be recycled by Google when idle for a certain amount of time (i.e., overnight).
Furthermore, the VM that is being used — including any added files or packages — won’t be shared, so the team at Colab very smartly suggest that you include cells which install and load any custom libraries or files.