开始使用

排查常见 YOLO 问题

YOLO common training and deployment issues

本指南介绍使用 Ultralytics YOLO26 时最常遇到的问题,并按问题出现的环节分类:安装、模型训练、预测和部署。跳转到与你遇到的错误对应的类别,或浏览常见问题,快速查找答案。每个条目都会说明问题,并提供可以直接应用的具体解决方法。



观看: Ultralytics YOLO26 常见问题 | 安装错误、模型训练问题

常见问题#

安装错误#

安装错误可能由多种原因导致,例如版本不兼容、缺少依赖项或环境配置不正确。首先,检查以下事项:

  • 你使用的是 Python 3.8 或更高版本。
  • 你已安装兼容版本的 PyTorch(1.8 或更高版本)。
  • 你正在使用虚拟环境,以避免发生冲突。
  • 按照官方安装指南逐步操作。

此外,以下是常见安装问题的解决方法。

保持 Ultralytics 及其依赖项为最新版本

许多导入、GPU 和导出错误只需升级即可修复。运行 pip install -U ultralytics,并确认 PyTorch 和 CUDA 版本兼容,然后再进行更深入的调试。

导入错误或依赖项问题#

如果导入 YOLO26 时出错或遇到依赖项冲突,请尝试以下步骤:

  • 全新安装:从干净的安装环境开始可以解决意外问题,尤其是在更新改变了包结构或功能之后。
  • 定期更新:使用最新版本的库,因为旧版本可能与近期更新不兼容。
  • 检查依赖项:确认所有必需的依赖项都已正确安装,且版本彼此兼容。
  • 查看变更:如果你安装的是旧版本,请参阅官方文档或变更日志,了解任何重大的结构变化。

在 GPU 上运行 YOLO26#

如果在 GPU 上运行 YOLO26 时遇到问题,可以尝试以下排查步骤:

  • 验证 CUDA 兼容性和安装情况:确保你的 GPU 兼容 CUDA,并且 CUDA 已正确安装。使用 nvidia-smi 命令检查 NVIDIA GPU 和 CUDA 版本的状态。
  • 检查 PyTorch 与 CUDA 的集成:在 Python 终端中运行 import torch; print(torch.cuda.is_available()),确保 PyTorch 能够使用 CUDA。如果返回 True,则表示 PyTorch 已配置为使用 CUDA。
  • 激活环境:确保你位于已安装所有必需软件包的正确环境中。
  • 更新软件包:过时的软件包可能与 GPU 不兼容。请保持软件包为最新版本。
  • 程序配置:检查代码是否请求使用 GPU。运行训练或预测时,你可以设置 device 参数(例如 device=0)。
较旧的 GPU 和 cuDNN 9.11.0+

cuDNN 9.11.0 已停止支持 Turing 之前的 GPU 架构,即计算能力 (SM) 低于 7.5 的架构,例如 GTX 1080 Ti。在较旧的 GPU 上,你可能需要使用针对较早 CUDA/cuDNN 版本编译的 PyTorch 构建版本。使用以下命令检查你的配置:

import torch

cap = torch.cuda.get_device_capability(0) if torch.cuda.is_available() else (0, 0)
cudnn = torch.backends.cudnn.version() or 0
ok = "not compatible" if cudnn >= 91100 and (cap[0] < 7 or (cap[0] == 7 and cap[1] < 5)) else "should be ok"
print(f"Compute capability: SM {cap[0]}.{cap[1]}, cuDNN: {cudnn} => {ok}")

模型训练问题#

下面介绍常见训练问题及其解决方法。

验证配置设置#

问题:你不确定模型训练期间 .yaml 文件中的配置设置是否已正确应用。

解决方法:数据集设置和训练设置分别存储在不同的 .yaml 文件中,并通过 model.train() 的不同参数传入。要确保这些设置已正确应用,请按以下步骤操作:

  • 确认 .yaml 文件的路径正确。

  • 将数据集 .yaml(路径、类别名称、数据集划分)作为 data 参数传入,并将自定义训练设置 .yaml(例如 epochs 或 lr0)作为 cfg 参数传入。直接传给 model.train() 的参数优先级高于这两者:

    model.train(data="/path/to/your/data.yaml", cfg="/path/to/your/cfg.yaml", batch=4)

使用多块 GPU 加速训练#

问题:单块 GPU 上的训练速度很慢,你想使用多块 GPU 来加快训练。

解决方法:增大批次大小可以加快训练,但必须考虑 GPU 内存容量。要使用多块 GPU加快训练,请按以下步骤操作:

  • 确保你有多块可用的 GPU。

  • 将 device 参数设为 GPU 索引列表,例如 device=[0,1,2,3]。

  • 相应地增大批次大小,以充分利用多块 GPU,同时避免超出内存限制。

  • 修改训练命令以使用多块 GPU:

    # 根据需要调整批次大小和其他设置,以优化训练速度
    model.train(data="/path/to/your/data.yaml", batch=32, device=[0, 1, 2, 3])

持续监控的参数#

问题:除了损失值之外,你还想知道训练期间应该持续监控哪些参数。

解决方法:损失值是需要监控的重要指标,但跟踪其他指标对于优化模型性能也很重要。训练期间需要监控的一些关键指标包括:

你可以从训练日志中查看这些指标,也可以使用 TensorBoard 或 Weights & Biases 等工具进行可视化。使用 patience 训练参数进行早停(默认在验证指标连续 100 个 epoch 没有改善后停止),有助于避免浪费训练轮次和过拟合。

跟踪训练进度的工具#

问题:你想了解用于跟踪训练进度的工具推荐。

解决方法:要跟踪并可视化训练进度,可以考虑使用以下工具:

  • TensorBoard:TensorBoard 是一种常用工具,可用于可视化训练指标,包括损失值、准确率等。你可以将它集成到 YOLO26 训练流程中。
  • Comet:Comet 提供了一套完善的工具,用于跟踪和比较实验。它可以跟踪指标、超参数,甚至模型权重。它也能轻松集成 YOLO 模型,让你全面了解整个实验周期。
  • Ultralytics Platform:Ultralytics Platform 会将 YOLO 训练运行与数据集和模型一同跟踪,让你可以在一个地方比较指标并与团队协作。

如何检查训练是否正在 GPU 上进行#

问题:训练日志中的 device 值为 null,你不确定训练是否正在 GPU 上进行。

解决方案:null 的 device 值通常表示训练过程设置为自动选择可用 GPU,这是默认行为。若要在特定 GPU 上训练,请在开始训练时设置 device 参数。device 是训练参数,因此在数据集 .yaml 中设置该参数不会生效:

from ultralytics import YOLO

# 加载模型
model = YOLO("yolo26n.pt")

# 使用 GPU 0;多块 GPU 时使用 device=[0, 1],使用 CPU 时使用 device="cpu"
model.train(data="path/to/data.yaml", device=0)

留意 runs 文件夹中的日志和指标,以便有效监控训练进度。

有效模型训练的关键注意事项#

如果遇到与模型训练相关的问题,请牢记以下几点。

数据集格式和标签

  • 重要性:任何机器学习模型的基础,都在于其训练数据的质量和格式。
  • 建议:确保你的自定义数据集及其相关标签符合预期格式。务必确认标注准确且质量高。错误或质量欠佳的标注会妨碍模型学习,导致不可预测的结果。

模型收敛

  • 重要性:模型收敛意味着模型已从训练数据中充分学习。
  • 建议:从头开始训练模型时,确保模型达到令人满意的收敛水平至关重要。与微调现有模型相比,这可能需要更长的训练时间和更多的 epoch。

学习率和批次大小

  • 重要性:这些超参数决定了模型在训练期间如何更新权重。
  • 建议:定期评估所选学习率和批次大小是否适合你的特定数据集,并考虑进行超参数调优,以寻找更合适的值。与数据集特征不匹配的参数会妨碍模型性能。

类别分布

  • 重要性:数据集中的类别分布会影响模型的预测倾向。
  • 建议:定期评估数据集中的类别分布,例如使用数据集审计脚本。如果存在类别不平衡,模型就可能偏向样本更多的类别。这种偏差可能会体现在混淆矩阵中,模型或许会主要预测多数类。

与预训练权重交叉验证

  • 重要性:利用预训练权重可以为模型训练提供良好的起点,尤其是在数据有限时。
  • 建议:作为诊断步骤,可以使用相同数据训练模型,但通过预训练权重初始化。如果这种方法能生成结构良好的混淆矩阵,可能说明从头开始训练的模型需要进一步训练或调整。

以下介绍模型预测中常见的问题及其解决方法。

获取自定义 YOLO26 模型的边界框预测结果#

问题:使用自定义 YOLO26 模型进行预测时,边界框坐标的格式和可视化存在一些挑战。

解决方案:

  • 坐标格式:YOLO26 提供绝对像素值形式的边界框坐标。若要将坐标转换为相对坐标(范围为 0 到 1),需要除以图像尺寸。例如,图像尺寸为 640x640 时:

    # 将绝对坐标转换为相对坐标
    x1 = x1 / 640  # 将 x 坐标除以图像宽度
    x2 = x2 / 640
    y1 = y1 / 640  # 将 y 坐标除以图像高度
    y2 = y2 / 640

    或者,使用每个结果的 boxes.xyxyn 或 boxes.xywhn 属性,这些属性已返回归一化坐标。

  • 文件名:要获取正在预测的图像文件名,请在预测循环中从每个结果对象的 path 属性读取图像文件路径(例如 result.path)。

筛选 YOLO26 预测结果中的对象#

问题:使用 Ultralytics 库运行 YOLO26 时,难以在预测结果中筛选并仅显示特定对象。

解决方案:若要检测特定类别,请使用 classes 参数指定要在输出中包含的类别。例如,只检测汽车(COCO 中的类别索引为 2):

yolo segment predict model=yolo26n-seg.pt source='path/to/car.mp4' show=True classes=2

了解 YOLO26 中的精确率指标#

问题:对 YOLO26 中框精确率、掩码精确率和混淆矩阵精确率之间的区别感到困惑。

解决方案:框精确率使用 IoU(交并比)作为指标,衡量预测边界框与真实边界框的吻合程度。掩码精确率则在逐像素对象分类中评估预测分割掩码与真实掩码的一致性。另一方面,混淆矩阵精确率关注所有类别的整体分类准确率,不考虑预测结果的几何准确性。需要注意的是,即使类别预测错误,边界框在几何上仍可能准确(真正例),因此框精确率与混淆矩阵精确率可能有所不同。这些指标评估模型性能的不同方面,反映了不同任务需要采用不同评估指标。

提取 YOLO26 中的对象尺寸#

问题:难以获取 YOLO26 中检测对象的宽度和高度,尤其是在图像中检测到多个对象时。

解决方案:要获取边界框尺寸,请先使用 Ultralytics YOLO26 模型在图像中预测对象。然后,从预测结果中提取边界框的宽度和高度信息。

from ultralytics import YOLO

# Load a pretrained YOLO26 model
model = YOLO("yolo26n.pt")

# Specify the source image
source = "https://ultralytics.com/images/bus.jpg"

# Make predictions
results = model.predict(source, save=True, imgsz=320, conf=0.25)

# Extract bounding box dimensions
boxes = results[0].boxes.xywh.cpu()
for box in boxes:
    x, y, w, h = box
    print(f"Width of Box: {w}, Height of Box: {h}")

部署挑战#

GPU 部署问题#

问题:在多 GPU 环境中部署模型有时会出现意外情况,例如内存使用异常或不同 GPU 上的结果不一致。

解决方案:检查是否存在 GPU 默认初始化。有些框架(例如 PyTorch)可能会先在默认 GPU 上初始化 CUDA 操作,然后才切换到指定 GPU。若要避免意外的默认初始化,请在部署和预测时直接指定 GPU。然后使用工具监控 GPU 利用率和内存使用情况,以便实时发现异常。此外,请确保使用框架或库的最新版本。

模型转换/导出问题#

问题:将机器学习模型转换或导出为不同格式或部署到不同平台时,用户可能会遇到错误或意外行为。

解决方案:查看导出模式文档中支持的格式和各格式选项,然后逐项完成以下检查:

  • 兼容性检查:确保所用的库和框架版本彼此兼容。版本不匹配可能会在转换过程中导致意外错误。
  • 重置环境:如果你使用的是 Jupyter 或 Colab 等交互式环境,可以在进行重大更改或安装后重启环境。重新启动有时可以解决潜在问题。
  • 官方文档:始终查阅所用转换工具或库的官方文档,其中通常包含模型导出的具体指南和最佳实践。
  • 社区支持:查看库或框架的官方代码仓库,看看其他用户是否报告过类似问题。维护者或社区可能已在讨论帖中提供解决方案或变通方法。
  • 定期更新:确保使用最新版本的工具或库。开发者经常发布更新,以修复已知错误或改进功能。
  • 逐步测试:在进行完整转换之前,先用较小的模型或数据集测试流程,以便尽早发现潜在问题。

社区与支持#

通过以下渠道和资源获取帮助并分享解决方案。

获取帮助的论坛和渠道#

GitHub Issues: Ultralytics 在 GitHub 上的代码库设有 Issues 标签页,你可以在这里提问、报告 Bug 和建议新功能。社区成员和维护者都积极参与交流,这也是针对具体问题寻求帮助的好地方。

Ultralytics Discord 服务器: Ultralytics 设有 Discord 服务器,你可以在那里与其他用户和开发者交流。

官方文档和资源#

Ultralytics YOLO26 文档:官方文档全面介绍了 YOLO26,并提供安装、使用和故障排除指南。

结论#

大多数 YOLO26 问题都源于少数几个原因:版本不匹配、数据集格式和 GPU 配置。如果这里没有介绍你遇到的错误,可以搜索 GitHub Issues 标签页,或在 Discord 服务器中提问——很可能已经有人解决了这个问题。对于更复杂的训练问题,请参阅模型训练技巧指南,了解如何在计算机视觉项目中取得更好效果的实用建议。

常见问题#

  • 安装错误通常由兼容性问题或缺少依赖项导致。请确保使用 Python 3.8 或更高版本,并安装 PyTorch 1.8 或更高版本。使用虚拟环境有助于避免冲突。要查看逐步安装指南,请参阅我们的官方安装指南。如果遇到导入错误,请尝试全新安装或将库更新到最新版本。

  • 单个 GPU 上的训练速度可能会因批量大小过大或内存不足而变慢。要加快训练速度,请使用多个 GPU。确保系统中有多个可用 GPU,并设置 device 参数,例如 device=[0,1,2,3]。相应地增大批量大小,以充分利用 GPU,同时避免超出内存限制。示例命令:

    model.train(data="/path/to/your/data.yaml", batch=32, device=[0, 1, 2, 3])
  • 如果训练日志中的 device 值显示为 null,通常表示训练过程设置为自动选择可用 GPU。若要明确指定某个 GPU,请在开始训练时传入 device 参数,例如使用 yolo train data=path/to/data.yaml device=0 指定第一个 GPU。运行 nvidia-smi 以确认 CUDA 配置。

  • 你可以使用 TensorBoard、Comet 和 Ultralytics Platform 等工具,高效地跟踪和可视化训练进度。这些工具可以记录和可视化损失、精确率、召回率和 mAP 等指标。根据这些指标实施早停也有助于取得更好的训练效果。

  • 确保数据集和标签符合预期格式。检查标注是否准确且质量良好。如果遇到问题,请参阅数据收集与标注指南,了解最佳实践。要获取更多针对数据集的指导,请查看文档中的数据集部分。

评论70

提出问题、分享结果,或帮助其他人。

  1. puzzlemindgamesGitHub

    I’ve been working on a browser-based puzzle solver project using Ultralytics YOLO for board and block detection. The model performs quite well locally, but I’m facing some inconsistent detection behavior after deployment and wanted to ask if anyone has experienced something similar.

    Current Stack: • YOLO (Ultralytics) • FastAPI • OpenCV • Python • Deployed on a low-memory cloud instance

    Issue: The model detects larger blocks correctly, but occasionally misses: • tightly packed shapes • small edge blocks • partially overlapping pieces • low-contrast screenshots from mobile devices This mostly happens on compressed screenshots uploaded by users.

    Current Inference Setup: from ultralytics import YOLO

    model = YOLO("best.pt")

    results = model.predict( source=image, imgsz=512, conf=0.35, max_det=100, verbose=False )

    Things I Already Tried • increasing imgsz • lowering confidence threshold • image sharpening with OpenCV • grayscale preprocessing • CLAHE contrast enhancement • retraining with more difficult samples

    Another Problem Memory usage spikes heavily during multiple inference requests. I solved most of it by forcing: WEB_CONCURRENCY=1 and reducing worker duplication, but I’m still curious if there’s a cleaner optimization strategy specifically for lightweight YOLO deployments.

    My Current Observation YOLO performs extremely well on clear geometric patterns, but puzzle-game screenshots seem tricky because: • blocks are visually similar • spacing is minimal • compression artifacts affect edges • mobile screenshots vary massively between devices

    Question Has anyone optimized YOLO specifically for: • grid-based games • puzzle detection • small repeated objects • mobile screenshot analysis

    Would love to hear: • pre-processing suggestions • augmentation ideas • lightweight deployment optimizations • whether segmentation models performed better for you

    For context, this is part of an AI-powered Block Blast solving project I’ve been experimenting with: https://www.aiblockblastsolver.com/ Appreciate any insights from people who’ve worked with similar detection challenges.

    1. Glenn JocherUltralytics

      For tightly packed small objects on compressed mobile screenshots, seg models often outperform pure detect, and the biggest gains usually come from training/inference at higher resolution plus augmentations that mimic JPEG artifacts, blur, scaling, and low contrast from real uploads; for deployment, keep one loaded model per process, warm it up, and use streaming-style inference to limit memory spikes, and if you can share a few failing images plus yolo checks in GitHub Discussions we can help narrow it down further—see Troubleshooting Common YOLO Issues, deployment best practices, and this small object mAP guide.

      1
    2. puzzlemindgamesGitHub

      Thanks for the detailed insights especially the point about segmentation models potentially outperforming pure detection for tightly packed puzzle objects.

      I’ve already started experimenting with stronger augmentation pipelines focused on: • JPEG compression artifacts • motion blur • brightness/contrast variation • slight perspective distortion and surprisingly, that alone improved small-shape consistency more than lowering confidence thresholds did. Furthermore, will explore the related guides and get back here if needed.

      Really appreciate the guidance.

    3. Glenn JocherUltralytics

      Good to hear that helped; the next thing I’d test is size-aware validation plus image tiling for training/inference, since tiny edge pieces often improve more from preserved spatial detail than from further conf tuning alone, and Model Evaluation Insights has a useful section on that.

  2. Mz-HanGitHub

    Hello, I am using the trained yolov26s-seg.pt for small object segmentation. When I set max-det to a value greater than 500, an error occurs. Would you have time to help me with this? Thank you very much!

    torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate4.95GiB (GPU 0;23.99 GiB total capacity;17.39 GiB already allocated; 0 bytes free; 17.65 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

    1. Glenn JocherUltralytics

      That error is expected when max_det is pushed very high for segmentation—memory scales with the number of kept detections (and masks), so max_det>500 can OOM on a 24GB GPU; best next steps are to raise conf, lower imgsz, or keep max_det lower (see the GPU/OOM notes in YOLO common issues troubleshooting). If you think it’s a bug, please paste a text (not screenshot) minimal repro command plus yolo checks output as described in Minimum Reproducible Example.

      yolo task=segment mode=predict model=yolo26s-seg.pt source=your.mp4 imgsz=640 conf=0.4 max_det=300 half=True device=0
      yolo checks

      If reserved memory is much larger than allocated, also try setting this before running Python (then restart your session/kernel):

      export PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:128
  3. EvelynStockardGitHub

    Troubleshooting common YOLO issues involves checking model configuration, image input size, and environment setup to ensure smooth performance. Many users face errors during training or inference while working with https://yolov8.org/ due to version mismatches or incorrect paths.

  4. dvdfaceGitHub

    I ran into a problem. when I started training by yolo cli, after yolo read train and val dataset, it quited, I can only saw many python process in background, but their cpu usage was zero, gpu usage was zero?

    what's happened? How to figure it out?

    I have tried use python script instead , the same problem occured.

    how to tackle it?

    1. Glenn JocherUltralytics

      @dvdface this sounds like a DataLoader multiprocessing issue that can cause training to hang. Try these solutions in order:

      1. Disable multiprocessing workers by adding workers=0 to your training command:

        yolo train model=yolo11n.pt data=dataset.yaml workers=0
      2. Check your environment - ensure you're using the latest ultralytics version:

        pip install -U ultralytics
      3. Verify GPU setup - test if CUDA is working properly:

        import torch
        print(torch.cuda.is_available())
      4. Try a fresh environment - create a new virtual environment and reinstall dependencies if the above doesn't work.

      The workers=0 fix usually resolves hanging issues during training initialization. Let me know if this helps!

  5. sjocnjfjdGitHub

    I have looled  the issue  guides,but I can not find what I  want to solve my problem

    ---Original--- From: "Glenn @.> Date: Sat, Dec 7, 2024 01:27 AM To: @.>; Cc: @.@.>; Subject: Re: [ultralytics/ultralytics] zh/guides/yolo-common-issues/(Discussion #11739)

    @sjocnjfjd your YAML file seems mostly correct, but be cautious with the file path formatting. Replace D:python新建文件夹 (2)/hakusenninnshiki.v2i.yolov11/lane.yaml with a properly formatted path (e.g., D:/python/新建文件夹 (2)/hakusenninnshiki.v2i.yolov11/lane.yaml). Ensure all dataset paths are accessible and the Roboflow url is valid. If issues persist, refer to the YOLO Common Issues guide for troubleshooting.

    — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

    1. Glenn JocherUltralytics

      @sjocnjfjd thank you for your comment. If you've already reviewed the issue guides and couldn't find a solution, please provide specific details about your problem, such as the error message or unexpected behavior you're encountering. This will help us assist you more effectively. Additionally, you can reference the YOLO Common Issues guide for further troubleshooting. Let us know how we can assist!

  6. sjocnjfjdGitHub

    it is my.yaml: path: D:python新建文件夹 (2)/hakusenninnshiki.v2i.yolov11/lane.yaml train: images/train val: images/val test: images/test

    nc: 1 names: ['hakusen']

    roboflow:   workspace: kitazonoken   project: hakusenninnshiki   version: 2   license: CC BY 4.0   url: https://universe.roboflow.com/kitazonoken/hakusenninnshiki/dataset/2 is it right ?

    ---Original--- From: "Glenn @.> Date: Fri, Dec 6, 2024 23:59 PM To: @.>; Cc: @.@.>; Subject: Re: [ultralytics/ultralytics] zh/guides/yolo-common-issues/(Discussion #11739)

    @sjocnjfjd the error indicates a file path issue. Ensure your data parameter points to the correct yaml file and check that the dataset paths defined in the yaml file are valid and accessible. For guidance on dataset preparation and troubleshooting, refer to YOLO Common Issues. Let us know if you need further clarification!

    — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

    1. Glenn JocherUltralytics

      @sjocnjfjd your YAML file seems mostly correct, but be cautious with the file path formatting. Replace D:python新建文件夹 (2)/hakusenninnshiki.v2i.yolov11/lane.yaml with a properly formatted path (e.g., D:/python/新建文件夹 (2)/hakusenninnshiki.v2i.yolov11/lane.yaml). Ensure all dataset paths are accessible and the Roboflow url is valid. If issues persist, refer to the YOLO Common Issues guide for troubleshooting.

  7. sjocnjfjdGitHub

    100 epochs completed in 0.146 hours. Optimizer stripped from runs/detect/train/weights/last.pt, 5.5MB Optimizer stripped from runs/detect/train/weights/best.pt, 5.5MB

    Validating runs/detect/train/weights/best.pt... Ultralytics 8.3.44 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB) YOLO11n summary (fused): 238 layers, 2,582,347 parameters, 0 gradients, 6.3 GFLOPs

    FileNotFoundError Traceback (most recent call last) in <cell line: 4>() 2 3 model = YOLO('https://hub.ultralytics.com/models/kYDnuTY9JD3hHyFdnc5T') ----> 4 results = model.train(data='"D://python//新建文件夹 (2)//hakusenninnshiki.v2i.yolov11//lane.yaml"', project='runs/train', name='exp', epochs=100)

    6 frames /usr/local/lib/python3.10/dist-packages/ultralytics/data/utils.py in check_det_dataset(dataset, autodownload) 327 else: 328 m += f"\nNote dataset download directory is '{DATASETS_DIR}'. You can update this in '{SETTINGS_FILE}'" --> 329 raise FileNotFoundError(m) 330 t = time.time() 331 r = None # success

    FileNotFoundError: Dataset '/content/datasets/lane/lane.yaml' images not found ⚠️, missing path '/content/datasets/D:python新/建文件夹 (2)/hakusenninnshiki.v2i.yolov11/lane.yaml/images/val' Note dataset download directory is '/content/datasets'. You can update this in '/root/.config/Ultralytics/settings.json' why can i deploy

    1. Glenn JocherUltralytics

      @sjocnjfjd the error indicates a file path issue. Ensure your data parameter points to the correct yaml file and check that the dataset paths defined in the yaml file are valid and accessible. For guidance on dataset preparation and troubleshooting, refer to YOLO Common Issues. Let us know if you need further clarification!

  8. tylerfrisinger01GitHub

    is it possible that YOLOv11 will take a lot longer to train compared to YOLOv8? My model is currently doing about 1 epoch every hour and a half. I currently have it so it will do 300 epochs as recommended on the training page. Should i switch to YOLOv8 instead?

    1. tylerfrisinger01GitHub

      Is there anything I can do to increase the speed of training either v8 or v11? At this point I’m concerned it may take days. Should I only do 100 epochs the first training round and then train it again at 100? And again and again?

  9. xsvebmxGitHub

    Please help (

    cmd> yolo task=detect mode=train model=yolov8s.pt data=data_custom.yaml epochs=50 imgsz=640 batch=8

    train: Scanning X:\Desktop\NNXTSSS\train\labels.cache... 1 images, 12 backgrounds, 0 corrupt: 100%|██████████| 12/12 [00:00<?, ?it/s] WARNING ⚠️ No labels found in X:\Desktop\NNXTSSS\train\labels.cache, training may not work correctly. See https://docs.ultralytics.com/datasets for dataset formatting guidance. val: Scanning X:\Desktop\NNXTSSS\val\labels.cache... 0 images, 5 backgrounds, 0 corrupt: 100%|██████████| 5/5 [00:00<?, ?it/s] WARNING ⚠️ No labels found in X:\Desktop\NNXTSSS\val\labels.cache, training may not work correctly. See https://docs.ultralytics.com/datasets for dataset formatting guidance. Plotting labels to runs\detect\train7\labels.jpg... zero-size array to reduction operation maximum which has no identity

    WARNING ⚠️ no labels found in detect set, can not compute metrics without labels

      Epoch    GPU_mem   box_loss   cls_loss   dfl_loss  Instances       Size
       2/50      2.02G          0      210.6          0          0        640: 100%|██████████| 2/2 [00:02<00:00,  1.45s/it]
                 Class     Images  Instances      Box(P          R      mAP50  mAP50-95):   0%|          | 0/1 [00:00<?, ?it/s]

    files

    data_custom.yaml

    val: X:/Desktop/NNXTSSS/val
    nc: 1
    
    names: ["hat"]```
    1. Glenn JocherUltralytics

      @xsvebmx it seems like there are no labels found in your dataset, which is causing the training issues. Please ensure that your label files are correctly formatted and located in the specified directories. You can refer to the dataset formatting guide at https://docs.ultralytics.com/datasets for more details. If the issue persists, double-check the paths in your data_custom.yaml file to ensure they point to the correct locations.

      1
    2. xsvebmxGitHub

      I was stupid , I compiled the data set incorrectly, and because of this, an error was issued, Thank you for support😁 (i wanna sleep😭)

  10. ManojShakyaGitHub

    Subject: Issue with False Object Detections in YOLOv8 Pre-Trained Model

    Dear Ultralytics Team,

    I am encountering an issue while using a pre-trained YOLOv8 model for object detection. When I input an image containing two objects, such as a cat and a dog, the model unexpectedly detects multiple other objects like a keyboard, sheep, car, train, bus, and more—none of which are actually present in the image and with 100 percentage probability score.

    Could you please provide guidance on how to resolve this issue? Any advice or recommendations would be greatly appreciated.

    1. Glenn JocherUltralytics

      @ManojShakya thank you for reaching out. It sounds like there might be an issue with the model's confidence threshold or potential data inconsistencies. First, ensure you're using the latest version of the YOLOv8 package. If the issue persists, try adjusting the confidence threshold to filter out low-confidence detections. Additionally, verify that your input images and annotations are correctly formatted. For more detailed troubleshooting, please refer to our Common Issues Guide.