Training YOLO11 with ClearML: Streamlining Your MLOps Workflow
MLOps bridges the gap between creating and deploying machine learning models in real-world settings. It focuses on efficient deployment, scalability, and ongoing management to ensure models perform well in practical applications.
Ultralytics YOLO11 effortlessly integrates with ClearML, streamlining and enhancing your object detection model's training and management. This guide will walk you through the integration process, detailing how to set up ClearML, manage experiments, automate model management, and collaborate effectively.
ClearML
ClearML is an innovative open-source MLOps platform that is skillfully designed to automate, monitor, and orchestrate machine learning workflows. Its key features include automated logging of all training and inference data for full experiment reproducibility, an intuitive web UI for easy data visualization and analysis, advanced hyperparameter optimization algorithms, and robust model management for efficient deployment across various platforms.
YOLO11 Training with ClearML
You can bring automation and efficiency to your machine learning workflow by improving your training process by integrating YOLO11 with ClearML.
安装
要安装所需的软件包,请运行
For detailed instructions and best practices related to the installation process, be sure to check our YOLO11 Installation guide. While installing the required packages for YOLO11, if you encounter any difficulties, consult our Common Issues guide for solutions and tips.
配置ClearML
安装完必要的软件包后,下一步就是初始化和配置ClearML SDK。这包括设置ClearML 账户和获取必要的凭证,以便在开发环境和ClearML 服务器之间实现无缝连接。
首先初始化 ClearML 环境中的 SDK。这 'clearml-init' 命令启动安装过程并提示您输入必要的凭据。
执行该命令后,访问ClearML 设置页面。导航至右上角并选择 "设置"。转到 "工作区 "部分,点击 "创建新凭证"。根据您是在 Jupyter Notebook 还是本地Python 环境中配置ClearML ,使用 "创建凭据 "弹出窗口中提供的凭据按说明完成设置。
使用方法
Before diving into the usage instructions, be sure to check out the range of YOLO11 models offered by Ultralytics. This will help you choose the most appropriate model for your project requirements.
使用方法
from clearml import Task
from ultralytics import YOLO
# Step 1: Creating a ClearML Task
task = Task.init(project_name="my_project", task_name="my_yolov8_task")
# Step 2: Selecting the YOLO11 Model
model_variant = "yolo11n"
task.set_parameter("model_variant", model_variant)
# Step 3: Loading the YOLO11 Model
model = YOLO(f"{model_variant}.pt")
# Step 4: Setting Up Training Arguments
args = dict(data="coco8.yaml", epochs=16)
task.connect(args)
# Step 5: Initiating Model Training
results = model.train(**args)
了解守则
让我们了解上面的使用代码片段中展示的步骤。
步骤 1:创建ClearML 任务:在ClearML 中初始化一个新任务,指定项目和任务名称。该任务将跟踪和管理模型的训练。
Step 2: Selecting the YOLO11 Model:""""""""""""等字样。 model_variant
variable is set to 'yolo11n', one of the YOLO11 models. This variant is then logged in ClearML for tracking.
Step 3: Loading the YOLO11 Model: The selected YOLO11 model is loaded using Ultralytics' YOLO class, preparing it for training.
步骤 4:设置训练论据:关键的训练参数,如数据集 (coco8.yaml
) and the number of epochs (16
) 整理成字典,并与ClearML 任务相连。这样就可以通过ClearML UI 进行跟踪和潜在修改。要详细了解模型训练过程和最佳实践,请参阅我们的 YOLO11 Model Training guide.
步骤 5:启动模型培训:使用指定参数开始模型训练。训练过程的结果保存在 results
变量。
了解输出
运行上面的使用代码片段后,输出结果如下:
- 一条确认信息,表明创建了一个新的ClearML 任务,并提供了该任务的唯一 ID。
- 关于存储脚本代码的信息提示,表明ClearML 正在跟踪代码执行情况。
- 指向ClearML 结果页面的 URL 链接,您可在此监控训练进度并查看详细日志。
- Download progress for the YOLO11 model and the specified dataset, followed by a summary of the model architecture and training configuration.
- Initialization messages for various training components like TensorBoard, Automatic Mixed Precision (AMP), and dataset preparation.
- 最后,训练过程开始,模型在指定数据集上进行训练时会更新进度。要深入了解训练过程中使用的性能指标,请阅读我们的性能指标指南。
查看ClearML 结果页面
点击使用代码片段输出中的ClearML 结果页面 URL 链接,就可以全面查看模型的训练过程。
ClearML 结果页面的主要功能
-
实时指标跟踪
- Track critical metrics like loss, accuracy, and validation scores as they occur.
- 提供即时反馈,及时调整模型性能。
-
实验比较
- 并排比较不同的训练运行。
- Essential for hyperparameter tuning and identifying the most effective models.
-
详细日志和输出
- 访问综合日志、指标图形表示法和控制台输出。
- 加深对模特行为和问题解决的理解。
-
资源利用监测
- 监控计算资源的使用情况,包括CPU 、GPU 和内存。
- 优化培训效率和成本的关键。
-
模型工件管理
- 查看、下载和共享模型工件,如训练有素的模型和检查点。
- Enhances collaboration and streamlines model deployment and sharing.
有关ClearML 结果页面的直观演示,请观看下面的视频:
观看: YOLO11 MLOps Integration using ClearML
高级功能ClearML
ClearML 提供多种高级功能,可增强您的 MLOps 体验。
远程执行
ClearML的远程执行功能有助于在不同机器上复制和操作实验。它记录已安装软件包和未提交更改等重要细节。当任务被挂起时,ClearML Agent 会将其拉出,重新创建环境并运行实验,同时报告详细结果。
部署ClearML Agent 非常简单,可使用以下命令在不同机器上完成:
这种设置适用于云虚拟机、本地 GPU 或笔记本电脑。ClearML 自动扩展器可帮助管理 AWS、GCP 和 Azure 等平台上的云工作负载,自动部署代理并根据资源预算调整资源。
克隆、编辑和排队
ClearML的用户友好界面可以轻松克隆、编辑和启动任务。用户可以克隆现有的实验,通过用户界面调整参数或其他细节,然后排队执行任务。这一简化流程可确保ClearML Agent 在执行任务时使用最新配置,因此非常适合迭代实验和模型微调。
摘要
This guide has led you through the process of integrating ClearML with Ultralytics' YOLO11. Covering everything from initial setup to advanced model management, you've discovered how to leverage ClearML for efficient training, experiment tracking, and workflow optimization in your machine learning projects.
有关使用的详细信息,请访问ClearML 的官方文档。
此外,您还可以访问Ultralytics 集成指南页面,了解Ultralytics 的更多集成和功能,该页面是资源和见解的宝库。
常见问题
What is the process for integrating Ultralytics YOLO11 with ClearML?
Integrating Ultralytics YOLO11 with ClearML involves a series of steps to streamline your MLOps workflow. First, install the necessary packages:
接下来,在环境中使用ClearML SDK 初始化:
You then configure ClearML with your credentials from the ClearML Settings page. Detailed instructions on the entire setup process, including model selection and training configurations, can be found in our YOLO11 Model Training guide.
Why should I use ClearML with Ultralytics YOLO11 for my machine learning projects?
Using ClearML with Ultralytics YOLO11 enhances your machine learning projects by automating experiment tracking, streamlining workflows, and enabling robust model management. ClearML offers real-time metrics tracking, resource utilization monitoring, and a user-friendly interface for comparing experiments. These features help optimize your model's performance and make the development process more efficient. Learn more about the benefits and procedures in our MLOps Integration guide.
How do I troubleshoot common issues during YOLO11 and ClearML integration?
If you encounter issues during the integration of YOLO11 with ClearML, consult our Common Issues guide for solutions and tips. Typical problems might involve package installation errors, credential setup, or configuration issues. This guide provides step-by-step troubleshooting instructions to resolve these common issues efficiently.
How do I set up the ClearML task for YOLO11 model training?
Setting up a ClearML task for YOLO11 training involves initializing a task, selecting the model variant, loading the model, setting up training arguments, and finally, starting the model training. Here's a simplified example:
from clearml import Task
from ultralytics import YOLO
# Step 1: Creating a ClearML Task
task = Task.init(project_name="my_project", task_name="my_yolov8_task")
# Step 2: Selecting the YOLO11 Model
model_variant = "yolo11n"
task.set_parameter("model_variant", model_variant)
# Step 3: Loading the YOLO11 Model
model = YOLO(f"{model_variant}.pt")
# Step 4: Setting Up Training Arguments
args = dict(data="coco8.yaml", epochs=16)
task.connect(args)
# Step 5: Initiating Model Training
results = model.train(**args)
有关这些步骤的详细说明,请参阅我们的使用指南。
Where can I view the results of my YOLO11 training in ClearML?
After running your YOLO11 training script with ClearML, you can view the results on the ClearML results page. The output will include a URL link to the ClearML dashboard, where you can track metrics, compare experiments, and monitor resource usage. For more details on how to view and interpret the results, check our section on Viewing the ClearML Results Page.