For the complete documentation index, see llms.txt. This page is also available as Markdown.

Train model on Google Colab

Welcome to Google Colab! This is where we rent a powerful cloud computer from Google for free to train our AI.

Colab notebooks run code in "blocks" or "cells." To train your model, you do not need to write any code from scratch, you just need to run the blocks in the correct order by clicking the Play button next to each one.

Work from top to bottom. Wait for each cell to finish before running the next one.

Training workflow

1

Run the Setup

Start at the top of the notebook and click "Play" on the introductory cells to set up your cloud computer.

  • Action: Run the Testing Dataset cells.

  • Skip: Do not run the "Local train setup (Advanced)" section. That is only for people running this on their home computers!

The local training section requires a computer-based setup. Skip it when using Google Colab.

2

Load Your Dataset

Tell the AI where to find the images you chose in Step 1. You only need to run the section that matches your dataset!

  • Action: If you downloaded from Roboflow, run only the cells under ROBOFLOW DATASET.

  • Action: If you downloaded from Kaggle, run only the cells under KAGGLE DATASET.

3

Start the Training

This is the main event!

  • Action: Scroll down to the Training process section and click Play.

  • Wait: The code will start running, and you will see numbers scrolling on your screen as the AI studies your images. Leave this tab open and do not close your browser! This can take anywhere from 10 minutes to an hour.

Training time depends on your dataset size and the available Colab hardware.

4

Export and Download

Once the training cell finishes running, you need to save your new AI so you can use it in the real world.

  • Action: Run the Export Model cell to package the AI.

  • Action: Run the Quantize and download cell. This compresses your model so it runs super fast on small hardware, and it will automatically download the final file directly to your computer.