일반적인 YOLO 문제 해결

YOLO common training and deployment issues

이 가이드에서는 Ultralytics YOLO26을 사용할 때 자주 발생하는 문제를 발생 위치에 따라 설치, 모델 학습, 예측, 배포로 나누어 다룹니다. 오류에 해당하는 카테고리로 이동하거나, 빠른 답변을 찾으려면 FAQ를 살펴보세요. 각 항목에는 문제와 바로 적용할 수 있는 구체적인 해결 방법이 제시되어 있습니다.



시청: 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+

GTX 1080 Ti처럼 컴퓨팅 성능(SM)이 7.5 미만인 Turing 이전 GPU 아키텍처에 대한 지원은 cuDNN 9.11.0에서 중단되었습니다. 구형 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 에포크 후 조기 종료)를 사용하면 불필요한 에포크와 과적합을 방지하는 데 도움이 됩니다.

학습 진행 상황 추적 도구#

문제: 학습 진행 상황을 추적할 도구를 추천받고 싶습니다.

해결 방법: 학습 진행 상황을 추적하고 시각화하려면 다음 도구를 고려해 보세요.

  • 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 폴더를 확인하세요.

효과적인 모델 학습을 위한 주요 고려 사항#

모델 학습 관련 문제가 발생하면 다음 사항을 고려하세요.

데이터셋 형식 및 레이블

  • 중요성: 모든 머신러닝 모델의 기반은 학습에 사용하는 데이터의 품질과 형식입니다.
  • 권장 사항: 사용자 지정 데이터셋과 관련 레이블이 예상 형식을 따르는지 확인하세요. 어노테이션의 정확도와 품질을 검증하는 것이 중요합니다. 부정확하거나 품질이 낮은 어노테이션은 모델의 학습을 방해해 예측할 수 없는 결과를 초래할 수 있습니다.

모델 수렴

  • 중요성: 모델이 학습 데이터에서 충분히 학습했음을 보장하려면 모델 수렴이 필요합니다.
  • 권장 사항: 모델을 '처음부터' 학습할 때는 모델이 만족스러운 수준으로 수렴하도록 해야 합니다. 기존 모델을 파인튜닝할 때보다 에포크를 늘려 학습 시간을 연장해야 할 수 있습니다.

학습률 및 배치 크기

  • 중요성: 이러한 하이퍼파라미터는 학습 중 모델이 가중치를 업데이트하는 방식을 결정합니다.
  • 권장 사항: 선택한 학습률과 배치 크기가 데이터 세트에 적합한지 정기적으로 평가하고, 더 나은 값을 찾기 위해 하이퍼파라미터 튜닝을 고려합니다. 데이터 세트의 특성과 맞지 않는 파라미터는 모델 성능을 저해할 수 있습니다.

클래스 분포

  • 중요성: 데이터셋의 클래스 분포는 모델의 예측 경향에 영향을 줄 수 있습니다.
  • 권장 사항: 예를 들어 데이터셋 감사 스크립트를 사용하여 데이터셋의 클래스 분포를 정기적으로 평가하세요. 클래스 불균형이 있으면 모델이 더 많이 나타나는 클래스에 편향될 위험이 있습니다. 이러한 편향은 모델이 주로 다수 클래스만 예측하는 혼동 행렬에서 드러날 수 있습니다.

사전 학습된 가중치와 교차 확인

  • 중요성: 사전 학습된 가중치를 활용하면 모델 학습을 위한 견고한 출발점을 마련할 수 있으며, 특히 데이터가 제한적인 경우 유용합니다.
  • 권장 사항: 진단 단계로 동일한 데이터를 사용하되 사전 학습된 가중치로 초기화해 모델을 학습하는 방법을 고려합니다. 이 방법으로 잘 구성된 혼동 행렬을 얻는다면, '처음부터' 학습한 모델에 추가 학습이나 조정이 필요할 수 있습니다.

모델 예측 중 흔히 발생하는 문제와 해결 방법은 아래와 같습니다.

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로 전환하기 전에 기본 GPU에서 CUDA 작업을 초기화할 수 있습니다. 예기치 않은 기본 초기화를 방지하려면 배포 및 예측 시 GPU를 직접 지정합니다. 그런 다음 도구를 사용해 GPU 사용률과 메모리 사용량을 모니터링하고 이상 징후를 실시간으로 파악합니다. 또한 프레임워크나 라이브러리의 최신 버전을 사용하고 있는지 확인합니다.

모델 변환/내보내기 문제#

문제: 머신러닝 모델을 다른 형식이나 플랫폼으로 변환하거나 내보내는 과정에서 오류나 예기치 않은 동작이 발생할 수 있습니다.

해결 방법: 내보내기 모드 문서에서 지원 형식과 형식별 옵션을 확인한 다음, 아래 항목을 점검하세요.

  • 호환성 확인: 서로 호환되는 라이브러리 및 프레임워크 버전을 사용하고 있는지 확인하세요. 버전이 일치하지 않으면 변환 중 예기치 않은 오류가 발생할 수 있습니다.
  • 환경 초기화: Jupyter 또는 Colab과 같은 대화형 환경을 사용하는 경우, 주요 변경이나 설치를 진행한 후 환경을 다시 시작해 보세요. 환경을 새로 시작하면 근본적인 문제가 해결될 수 있습니다.
  • 공식 문서: 변환에 사용하는 도구나 라이브러리의 공식 문서를 항상 참고하세요. 모델 내보내기에 관한 구체적인 지침과 모범 사례가 포함되어 있는 경우가 많습니다.
  • 커뮤니티 지원: 다른 사용자가 유사한 문제를 보고했는지 라이브러리 또는 프레임워크의 공식 저장소에서 확인하세요. 유지 관리자나 커뮤니티가 토론 스레드에 해결 방법이나 우회 방법을 제공했을 수 있습니다.
  • 정기 업데이트: 도구 또는 라이브러리의 최신 버전을 사용하고 있는지 확인하세요. 개발자는 알려진 버그를 수정하거나 기능을 개선하는 업데이트를 자주 배포합니다.
  • 단계별 테스트: 전체 변환을 수행하기 전에 더 작은 모델이나 데이터셋으로 프로세스를 테스트하여 잠재적인 문제를 조기에 파악하세요.

커뮤니티 및 지원#

다음 채널과 리소스를 통해 도움을 받고 해결 방법을 공유하세요.

도움을 받을 수 있는 포럼 및 채널#

GitHub 이슈: GitHub의 Ultralytics 저장소에는 질문을 하고, 버그를 보고하며, 새로운 기능을 제안할 수 있는 이슈 탭이 있습니다. 이곳에서는 커뮤니티 구성원과 유지 관리자가 활발히 활동하며, 구체적인 문제에 대한 도움을 받기에도 좋습니다.

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 인수를 전달합니다. 예를 들어 첫 번째 GPU에는 yolo train data=path/to/data.yaml device=0을 전달합니다. CUDA 설정을 확인하려면 nvidia-smi를 실행합니다.

  • 학습 진행 상황은 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.