YOLOでよくある問題のトラブルシューティング
このガイドでは、Ultralytics YOLO26の使用時によく発生する問題を、発生箇所ごとに分類して説明します。インストール、モデルのトレーニング、予測、デプロイが対象です。エラーに該当するカテゴリに移動するか、簡単な回答を確認するにはFAQをご覧ください。各項目には問題と、すぐに適用できる具体的な解決策を記載しています。
視聴: Ultralytics YOLO26のよくある問題 | インストールエラー、モデルのトレーニングに関する問題
よくある問題#
インストールエラー#
インストールエラーは、バージョンの互換性がない、依存関係が不足している、環境設定が誤っているなど、さまざまな理由で発生します。まず、以下を確認してください。
- Python 3.8以降を使用していることを確認してください。
- 互換性のあるバージョンのPyTorch(1.8以降)がインストールされていることを確認してください。
- 競合を避けるため、仮想環境を使用してください。
- 公式インストールガイドの手順に従ってください。
また、よくあるインストールの問題に対する解決策を以下に示します。
インポート、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)。
Turing以前のGPUアーキテクチャ(compute capability(SM)が7.5未満。GTX 1080 Tiなど)へのサポートは、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を使ったトレーニングの高速化#
問題: 1台の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=2YOLO26の適合率指標について#
問題: YOLO26におけるボックスPrecision、マスクPrecision、混同行列のPrecisionの違いがわかりません。
解決策: ボックスPrecisionは、IoU(Intersection over Union)を指標として、予測されたバウンディングボックスと実際の正解ボックスの一致度を測定します。マスクPrecisionは、ピクセル単位の物体分類において、予測されたセグメンテーションマスクと正解マスクの一致度を評価します。一方、混同行列のPrecisionは、すべてのクラスにわたる全体的な分類精度に着目し、予測の幾何学的な精度は考慮しません。クラス予測が誤っていても、バウンディングボックスの幾何学的精度が高く(真陽性で)ある場合があるため、ボックスPrecisionと混同行列のPrecisionに差が生じることに注意してください。これらの指標はモデルのパフォーマンスの異なる側面を評価するものであり、タスクごとに異なる評価指標が必要であることを示しています。
YOLO26でオブジェクトの寸法を抽出する#
問題: YOLO26で、特に1枚の画像内に複数の物体が検出された場合に、検出された物体の幅と高さを取得するのが難しいです。
解決策: バウンディングボックスの寸法を取得するには、まず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 Issues: GitHub上のUltralyticsリポジトリにはIssuesタブがあり、質問、バグ報告、新機能の提案ができます。コミュニティとメンテナーが活発に活動しており、具体的な問題についてサポートを得るのに最適な場所です。
Ultralytics Discordサーバー: UltralyticsにはDiscordサーバーがあり、ほかのユーザーや開発者と交流できます。
公式ドキュメントとリソース#
Ultralytics YOLO26 Docs: 公式ドキュメントでは、YOLO26の概要に加えて、インストール、使用方法、トラブルシューティングに関するガイドを提供しています。
結論#
YOLO26の問題の多くは、バージョンの不一致、データセットの形式、GPUの設定という、いくつかの原因に起因します。ここで取り上げていないエラーが発生した場合は、GitHub Issuesタブを検索するか、Discord serverで質問してください。すでに誰かが解決している可能性があります。より詳細なトレーニングの問題については、モデルのトレーニングに関するヒントガイドを参照し、コンピュータービジョンプロジェクトでより良い結果を得るための実践的なアドバイスをご確認ください。
よくある質問#
インストールエラーは、互換性の問題や依存関係の不足が原因で発生することがよくあります。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を使用します。nvidia-smiを実行してCUDAの設定を確認してください。トレーニングの進行状況の追跡と可視化は、TensorBoard、Comet、Ultralytics Platformなどのツールで効率的に行えます。これらのツールでは、損失、Precision、Recall、mAPなどの指標を記録して可視化できます。これらの指標に基づく早期終了を導入すると、トレーニング結果の改善にも役立ちます。
データセットとラベルが想定される形式に準拠していることを確認してください。アノテーションが正確で高品質であることも確認します。問題が発生した場合は、ベストプラクティスについてデータ収集とアノテーションガイドを参照してください。データセットに固有の詳細については、ドキュメントのデータセットセクションをご確認ください。
コメント70
質問したり、結果を共有したり、ほかの人をサポートしたりできます。
puzzlemindgames
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.
Glenn JocherUltralyticsFor tightly packed small objects on compressed mobile screenshots,
segmodels often outperform puredetect, 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 plusyolo checksin GitHub Discussions we can help narrow it down further—see Troubleshooting Common YOLO Issues, deployment best practices, and this small object mAP guide.1puzzlemindgames
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.
Glenn JocherUltralyticsGood 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
conftuning alone, and Model Evaluation Insights has a useful section on that.
Mz-Han
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
Glenn JocherUltralyticsThat error is expected when
max_detis pushed very high for segmentation—memory scales with the number of kept detections (and masks), somax_det>500can OOM on a 24GB GPU; best next steps are to raiseconf, lowerimgsz, or keepmax_detlower (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 plusyolo checksoutput 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 checksIf 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
EvelynStockard
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.
dvdface
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?
Glenn JocherUltralytics@dvdface this sounds like a DataLoader multiprocessing issue that can cause training to hang. Try these solutions in order:
-
Disable multiprocessing workers by adding
workers=0to your training command:yolo train model=yolo11n.pt data=dataset.yaml workers=0 -
Check your environment - ensure you're using the latest ultralytics version:
pip install -U ultralytics -
Verify GPU setup - test if CUDA is working properly:
import torch print(torch.cuda.is_available()) -
Try a fresh environment - create a new virtual environment and reinstall dependencies if the above doesn't work.
The
workers=0fix usually resolves hanging issues during training initialization. Let me know if this helps!-
sjocnjfjd
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: @.***>
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!
sjocnjfjd
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: @.***>
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.yamlwith a properly formatted path (e.g.,D:/python/新建文件夹 (2)/hakusenninnshiki.v2i.yolov11/lane.yaml). Ensure all dataset paths are accessible and the Roboflowurlis valid. If issues persist, refer to the YOLO Common Issues guide for troubleshooting.
sjocnjfjd
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
Glenn JocherUltralytics@sjocnjfjd the error indicates a file path issue. Ensure your
dataparameter points to the correctyamlfile and check that the dataset paths defined in theyamlfile are valid and accessible. For guidance on dataset preparation and troubleshooting, refer to YOLO Common Issues. Let us know if you need further clarification!
tylerfrisinger01
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?
Mohammed YasinUltralyticsYOLOv8 trains faster. But not a lot faster.
tylerfrisinger01
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?
Mohammed YasinUltralyticsYou can try training on Google Colab
xsvebmx
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]data_custom.yaml
val: X:/Desktop/NNXTSSS/val nc: 1 names: ["hat"]```xsvebmx
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.yamlfile to ensure they point to the correct locations.1xsvebmx
I was stupid , I compiled the data set incorrectly, and because of this, an error was issued, Thank you for support😁 (i wanna sleep😭)
ManojShakya
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.
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.