VOOZH about

URL: https://www.digitalocean.com/community/tutorials/train-yolov5-custom-data

⇱ How to Train YOLO v5 on a Custom Dataset | DigitalOcean


How to Train YOLO v5 on a Custom Dataset | DigitalOcean

Updated on August 4, 2025
👁 How to Train YOLO v5 on a Custom Dataset | DigitalOcean

Oct. 8, 2024 update: This tutorial now features some deprecated code for sourcing the dataset. Please see our updated tutorial on YOLOv7 for additional instructions on getting the dataset in a Jupyter Notebook for this demo.

Introduction

YOLO, or You Only Look Once, is one of the most widely used deep learning-based object detection algorithms. In this tutorial, we will go over how to train one of its latest variants, YOLOv5, on a custom dataset. More precisely, we will train the YOLO v5 detector on a road sign dataset. By the end of this post, you shall have an object detector that can localize and classify road signs. Before we begin, let me acknowledge that YOLOv5 attracted a lot of controversy when it was released over whether it’s right to call it v5. I’ve addressed this a bit at the end of this article. For now, I’d simply say that I’m referring to the algorithm as YOLOv5 since that is the name of the code repository.

Key takeaways:

  • YOLOv5 is a powerful and lightweight object detection model that’s great for training on custom datasets with minimal setup.
  • Preparing your dataset in the right format (images and annotated labels in YOLO format) is crucial for smooth training.
  • Using tools like LabelImg or Roboflow can save a lot of time when creating and organizing your training data.
  • Training YOLOv5 on DigitalOcean’s GPU Droplets gives you the speed and power needed to handle large datasets efficiently.
  • Once trained, your custom YOLOv5 model can accurately detect and classify objects specific to your use case—whether it’s people, products, or pets.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author(s)

👁 ayooshkaturia
ayooshkaturia
Author
👁 Shaoni Mukherjee
Shaoni Mukherjee
Editor
AI Technical Writer
See author profile

With a strong background in data science and over six years of experience, I am passionate about creating in-depth content on technologies. Currently focused on AI, machine learning, and GPU computing, working on topics ranging from deep learning frameworks to optimizing GPU-based workloads.

Still looking for an answer?

Was this helpful?

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

👁 Creative Commons
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
  • Limited Time: Introductory GPU Droplet pricing.

    Get simple AI infrastructure starting at $2.99/GPU/hr on-demand. Try GPU Droplets now!

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and AI-native businesses

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

© 2026 DigitalOcean, LLC.Sitemap.
Dark mode is coming soon.