Do you think you have to spend the big bucks to start your machine learning journey?

I don’t think you do!

Let’s see how you can train even large-scale machine learning models for free!

Google Colab

Is it free?

Yes absolutely!

You get one K80 GPU or even one TPU.

TPUs are Google’s fancy machine learning hardware.

What are the limits?

But there are limitations i.e. max 12h. If you’re running close to the deadline on your fantastic ICML paper, you might also not want to rely on this, as resources are not guaranteed.

Working Around the Limitations

There’s a trick though!

You can save your model to Google Drive regularly:

  1. Link Up Google Drive to Colab
  2. Save Keras Model Checkpoints

You can even work directly with the newest best model!

Because you can sync Google Drive to your local computer!

A Word Of Caution

Do not try to trick around with Google!

Like trying to run multiple notebooks for long times or automatically restart notebooks with scripts that circumvent Google intentions.

They are known to ban without recourse, which would be a shame.

Alternatively, you can pay for Colab Pro for 24h notebook runs.

Kaggle Notebooks

Kaggle Notebooks are another free alternative.

You get a Tesla P100!

There you can work in Notebooks and Scripts.

However, you are limited to 30h compute time on GPUs per week.

Working Around the Limitations

Only turn on the GPU if you plan on using the computation.

You can develop the code and test without enabling the GPU Accelerator.

Kaggle even provides tipps and tricks for efficient GPU usage!

You can even be, as clever as, only running the code on GPU, when you commit the code!

Use the Kaggle API

Use the API!

They really worked on this, but the website used to be painstakingly slow. So the API was a welcome change of environment.

Push a notebook to the Kaggle compute platform.

Especially when you’re using Kaggle datasets and not currently partaking in a Kaggle competition, this can be extremely useful for your machine learning needs.

Scale Up with AWS Free Tier

And here’s a tip if you want to scale one level up.

Google Cloud and Amazon Web Services all have Free Tiers.

Don’t get me wrong these are tiny instances and less capable than the free versions I just showed you.

However, you can use these free tiers to set up and test all your data connectivity and make sure your code is running.

Then, because this is the cloud, you can switch to a larger GPU-enabled instance relatively easy.

If you’re watching this before a hackathon, be aware that you often have to apply for access to larger GPU or even TPU instances before-hand which might take a few days to process. So plan ahead!

Google Educational

This one is for the early career researchers and students out there!

Google offers educational grants.

These can give you free compute time on their large cloud architecture.

I won one of their researcher grants and the compute I got was equivalent to over $100,000 US!

Check out the Google Edu Programs and the Research Cloud.

Conclusion

I like these free options for experimentation.

Their notebook interface is easy to use and very available.

Switching between CPU, GPU, and TPU instance is easy and fast too.

Scaling up in the cloud saving some money can be the next logical step unless you want to spend money on a GPU yourself.

Try it out now!

Spin up a Google Colab and try running your next deep learning model!