Train Your Machine Learning Models on Google’s GPUs for Free — Forever by@bourdakos1

Train Your Machine Learning Models on Google’s GPUs for Free — Forever

March 3rd 2018 67,428 reads
Read on Terminal Reader
react to story with heart
react to story with light
react to story with boat
react to story with money
image

image

Training your model is hands down the most time consuming and expensive part of machine learning. Training your model on a GPU can give you speed gains close to 40x, taking 2 days and turning it into a few hours. However, this normally comes at a cost to your wallet.

The other day I stumbled upon a great tool called Google Colab. I would describe Colab as the google docs equivalent of Jupyter notebooks. Colab is aimed at being an education and research tool for collaborating on machine learning projects. The great part is, that it’s completely free forever.

There is no setup to use it. I didn’t even need to log in. (I was already logged into my google account)

The best part is that you get an unlimited supply of 12 hours of continuous access to a k80 GPU, which is pretty powerful stuff. (You get disconnected after 12 hours, but you can use it as many times as you want)

I want our focus to be training on a GPU and Colab specific so the notebook is extremely bare bones.

The first step is to download (or another notebook of your choice)

Then, head over to Google Colab, sign into your google account (or create one if you somehow made it this far through life without one)

Choose File > Upload notebook...:

image

Upload the notebook you downloaded:

image

Choose Runtime > Change runtime type:

image

Then choose GPU:

image

Now you should be able to run your notebooks how you normally would. The only difference is the very last part at the end. If you want to download your model or any other files via the browser, you can use their python library:


from google.colab import filesfiles.download("PATH/TO/FILE")

Final Thoughts

This was a pretty short post, but hopefully it ends the painful days of training your models on your poor little old laptop for days at a time or dropping a ton of 💰 on AWS bills.

Thanks for reading! If you have any questions, feel free to reach out at [email protected], connect with me on LinkedIn, or follow me on Medium and Twitter.

If you found this article helpful, it would mean a lot if you gave it some applause👏 and shared to help others find it! And feel free to leave a comment below.

react to story with heart
react to story with light
react to story with boat
react to story with money
L O A D I N G
. . . comments & more!