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

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…

If you want to be massively successful, do NOT set ambitious goals, according to studies

The conventional model to having great success in your career is setting and ardently pursuing big, hairy, audacious goals (BHAGs), even if you have no idea how you’re going to achieve them when you start. Want to build a billion dollar company? Set the goal and work backward from long-term goals to medium-term goals to short-term goals to today’s to-do list. Then take action, measure your progress along the way, and constantly course correct so you’re always on the most direct path (that you’re aware of) toward your ultimate goal. Want to cure cancer? Set the goal and work backward. Measure your progress. Want to find the love of your life or be happy? Set the goal. Rinse and repeat. This goals model is so obvious in our culture, it goes without saying. It’s central to our collective success recipe. Goals give motivation, meaning, and focus when we feel lazy or distracted — at least so we’re told. However, recent research from the field of artificial intelligence is putting a nail in t…