Skip to main content

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

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 the notebook (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...:


Upload the notebook you downloaded:


Choose Runtime > Change runtime type:


Then choose GPU:



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 files
files.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 makcorpsapi@gmail.com.
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.




Comments

Post a Comment

Popular posts from this blog

Cheat Sheets for AI, Neural Networks, Machine Learning, Deep Learning & Big Data

Over the past few months, I have been collecting AI cheat sheets. From time to time I share them with friends and colleagues and recently I have been getting asked a lot, so I decided to organize and share the entire collection. To make things more interesting and give context, I added descriptions and/or excerpts for each major topic. This is the most complete list and the Big-O is at the very end, enjoy… If you like this list, you can let me know here Neural Networks

Neural Networks Cheat Sheet Neural Networks Graphs

Neural Networks Graphs Cheat Sheet



Neural Network Cheat Sheet Ultimate Guide to Leveraging NLP & Machine Learning for your Chatbot
Code Snippets and Github Includedchatbotslife.com
Machine Learning Overview

Machine Learning Cheat Sheet
Machine Learning: Scikit-learn algorithm This machine learning cheat sheet will help you find the right estimator for the job which is the most difficult part. The flowchart will help you check the documentation and rough guide of …

This Is Exactly How You Should Train Yourself To Be Smarter [Infographic]

Design inspired by the Cognitive Bias Codex
View the high resolution version of the infographic by clicking here. Out of all the interventions we can do to make smarter decisions in our life and career, mastering the most useful and universal mental models is arguably the most important. Over the last few months, I’ve written about how many of the most successful self-made billionaire entrepreneurs like Ray Dalio, Elon Musk, and Charlie Munger swear by mental models… “Developing the habit of mastering the multiple models which underlie reality is the best thing you can do. “ — Charlie Munger “Those who understand more of them and understand them well [principles / mental models] know how to interact with the world more effectively than those who know fewer of them or know them less well. “ — Ray Dalio “It is important to view knowledge as sort of a semantic tree — make sure you understand the fundamental principles, i.e. the trunk and big branches, before you get into the leav…

Warren Buffett: “Really Successful People Say No To Almost Everything”

When I tell people that Warren Buffett follows the 5-Hour Rule and spends 80% of his time reading and thinking, they have an immediate and predictable reaction: “Well, he can do that because he’s Warren Buffett, one of the richest people in the world. I could never do that.” While this response may help people feel better about themselves, it certainly won’t make them smarter. Because the reality is: Buffett has spent most of his time reading and thinking since he was in grade school. Having more money or managing a large company doesn’t magically give you free time. Having free time is never the default. People don’t just fall into huge blocks of free time unless they retire. Rather, free time is the result of strategy. It’s the result of looking at time differently. Curious about Buffett’s unique strategies, I’ve read several books about him, read most of his annual letters to stockholders, and watched nearly all of his interviews. And make no mistake about it… behind Buffett’s jovia…