Ultralytics YOLOの総合チュートリアル
Ultralytics YOLOガイドでは、トレーニングや予測からデプロイまで、ビジョンAIプロジェクトのあらゆる段階を解説します。PyTorchを基盤とするYOLOは、速度と精度を兼ね備え、リアルタイムの物体検出をはじめとするビジョンタスクに対応します。
ディープラーニングの初心者にもエキスパートにも、これらのチュートリアルは、コンピュータービジョンプロジェクトでYOLOを実装・最適化するための実践的なガイダンスを提供します。
視聴: Ultralytics YOLO26 ガイドの概要
ガイド#
ガイドはプロジェクトの段階ごとに分類されています。環境のセットアップやデータの準備から、トレーニング、評価、デプロイまで、作業中のステップにすぐ移動できます。
開始と計画#
- Condaクイックスタート:Ultralytics用のConda環境を構築する手順を解説します。Condaを使ってUltralyticsパッケージを効率よくインストールし、使い始める方法をご紹介します。
- Dockerクイックスタート:Dockerを使用してUltralytics YOLOモデルをセットアップし、利用するための完全ガイドです。Dockerのインストール方法、GPUサポートの管理方法、一貫性のある開発とデプロイのために、分離されたコンテナでYOLOモデルを実行する方法を説明します。
- コンピュータービジョンプロジェクトの目標を定義する:コンピュータービジョンプロジェクトの明確で測定可能な目標を効果的に定義する方法を順を追って説明します。明確に定義された問題提起の重要性と、それがプロジェクトのロードマップをどのように作成するかを学びます。
- コンピュータービジョンプロジェクトの手順:目標の定義、モデルの選択、データの準備、結果の評価など、コンピュータービジョンプロジェクトに必要な主要な手順を学びます。
- YOLOアーキテクチャの解説:YOLOv3からYOLO26までのYOLOアーキテクチャの変遷を、バックボーン、ネック、検出ヘッドにわたってたどり、C2f、C3k2、C2PSAアテンション、アンカーフリー、NMSフリーの設計を解説します。
データを準備する#
- データ収集とアノテーション:コンピュータービジョンモデル向けに高品質な入力データを作成するための、データ収集とアノテーションのツール、手法、ベストプラクティスをご紹介します。
- アノテーション済みデータの前処理:画像のリサイズ、正規化、データセットの分割、データ拡張、探索的データ分析(EDA)など、YOLO26を使ったコンピュータービジョン向けのデータ前処理を学びます。
- YOLOのデータ拡張: 基本的な変換から、モデルの堅牢性と性能を高める高度な手法まで、YOLOの幅広いデータ拡張テクニックをご紹介します。
- COCOからYOLOへの変換:トレーニング用にCOCO JSONアノテーションをYOLO形式へ変換する完全ガイドです。検出、セグメンテーション、キーポイントを取り上げ、クラスIDのマッピングやよくある変換時の落とし穴も解説します。
- COCO JSONでのトレーニング:カスタムデータセットクラスとトレーナーを使用して、YOLO形式に変換せずにCOCO JSONアノテーションでYOLOを直接トレーニングします。
トレーニングとファインチューニング#
- 高解像度タイル分割:あらゆるビジョンタスクで、固定サイズのタイルを使って高解像度画像のトレーニング、検証、予測を実行できます。
- モデルのトレーニングに関するヒント: バッチサイズの最適化、混合精度の使用、事前学習済み重みの適用など、コンピュータービジョンモデルをより効果的にトレーニングするためのヒントをご紹介します。
- カスタムデータでYOLOをファインチューニングする:事前学習済み重みを使ってカスタムデータセットでYOLO26をファインチューニングする完全ガイドです。転移学習、レイヤーの凍結、オプティマイザーの選択、2段階トレーニング、トラブルシューティングを解説します。
- YOLO26トレーニングレシピ:COCOで公式YOLO26ベースチェックポイントをトレーニングする際に使用するハイパーパラメーター、データ拡張パイプライン、オプティマイザー設定の完全なドキュメントと、実践的なファインチューニングの指針です。
- ハイパーパラメーターのチューニング:Tunerクラスと遺伝的進化アルゴリズムを使ってハイパーパラメーターをファインチューニングし、YOLOモデルを最適化する方法をご紹介します。
- 知識蒸留:特徴ベースの蒸留を用いて、大きな教師モデルから小さな生徒モデルへ知識を転移し、モデルの性能を向上させる方法を学びます。
- K分割交差検証: K分割交差検証手法を使ってモデルの汎化性能を向上させる方法を学びます。
- トレーナーのカスタマイズ:YOLOトレーナーをサブクラス化し、カスタムメトリクスのログ記録、クラス重み付き損失の追加、モデル保存のカスタマイズ、バックボーンの凍結・凍結解除、レイヤーごとの学習率の設定を行う方法を学びます。
- モデルYAML設定ガイド: Ultralyticsモデルのアーキテクチャ定義を詳しく解説します。YAML形式を確認し、モジュール解決システムを理解して、カスタムモジュールの統合方法を学びます。
評価とトラブルシューティング#
- YOLOの性能メトリクス ⭐ 必読:YOLOモデルの性能評価に使用するmAP、IoU、F1スコアなどの主要なメトリクスを理解します。検出精度と速度を向上させるための実践例とヒントも含まれています。
- モデル評価とファインチューニングに関する知見:mAPやIoUなどのメトリクスでコンピュータービジョンモデルを評価し、メトリクスから明らかになった点を踏まえて検出精度を向上させます。
- モデルのテスト:未知のデータでコンピュータービジョンモデルをテストし、YOLO26モデルを検証して、デプロイ前に過学習、未学習、データリークを見つける方法を学びます。
- YOLOでよくある問題 ⭐ おすすめ:Ultralytics YOLOモデルを扱う際によく発生する問題への実践的な解決策とトラブルシューティングのヒントをご紹介します。
- コンピュータービジョンモデルの保守: コンピュータービジョンモデルの精度を維持し、異常を検出してデータドリフトを軽減するための、モニタリング、保守、ドキュメント作成の主要な手法を解説します。
デプロイとサービング#
- モデルのデプロイオプション:ONNX、OpenVINO、TensorRTなどのYOLOモデルのデプロイ形式を概説し、それぞれの長所と短所を示してデプロイ戦略の策定に役立てます。
- モデルデプロイのベストプラクティス:最適化、トラブルシューティング、セキュリティに重点を置き、コンピュータービジョンプロジェクトでモデルを効率よくデプロイするためのヒントとベストプラクティスを順を追って解説します。
- YOLO以外のモデルをエクスポートする:Ultralyticsのスタンドアロンエクスポートユーティリティを使って、任意の
torch.nn.Module(timm、torchvision、カスタムモデル)をTorchScript、ONNX、OpenVINO、CoreML、Core AI、TensorFlow SavedModel、PaddlePaddle、MNN、NCNN、ExecuTorchに変換します。 - エンドツーエンド検出:NMSまたはNMSフリーの推論を選択し、出力形式とエクスポートの互換性を理解します。
- YOLOのスレッドセーフな推論:YOLOモデルでスレッドセーフに推論を実行するためのガイドラインです。スレッドセーフの重要性と、競合状態を防いで一貫した予測を実現するベストプラクティスを学びます。
- OpenVINOのレイテンシーモードとスループットモード:YOLO推論の性能を最大限に引き出すための、レイテンシーとスループットの最適化手法を学びます。
- セグメンテーション対象の切り出し: Ultralyticsのセグメンテーションモデルを使って、画像から物体を抽出・分離する手順を説明します。
- ターミナルで推論画像を表示: Remote TunnelまたはSSHセッションで推論結果を表示するには、VS Codeの統合ターミナルを使用します。
NVIDIA Jetson、Raspberry Pi、NVIDIA Triton、Google Vertex AIなど、特定のハードウェア、サービングスタック、クラウドプラットフォームに関するガイドは、Integrationsに掲載されています。
ガイドへの貢献#
コミュニティからの貢献を歓迎します。Ultralytics YOLOの特定の分野に精通していて、まだガイドで扱われていない内容があれば、ぜひ知識を共有してください。ガイドの執筆はコミュニティに貢献し、ドキュメントをより包括的で使いやすくするための優れた方法です。
まず、プルリクエスト(PR)の作成方法に関するガイドラインを確認するため、貢献ガイドをお読みください。新しいガイドを追加する際は、プロジェクトの段階に合った上記のカテゴリに配置し、手順を追うチュートリアル、タスクに特化したハウツー、リファレンスのいずれか1種類にまとめてください。コレクションが増えても閲覧しやすい状態を保てます。皆様からの貢献をお待ちしています。
よくある質問#
Ultralytics YOLOでカスタム物体検出モデルをトレーニングするのは簡単です。まず、データセットを正しい形式で準備し、Ultralyticsパッケージをインストールします。次のコードでトレーニングを開始します。
例from ultralytics import YOLO model = YOLO("yolo26n.pt") # 事前学習済みのYOLOモデルを読み込む model.train(data="path/to/dataset.yaml", epochs=50) # カスタムデータセットでトレーニングYOLOモデルの性能を評価することは、その有効性を理解するうえで非常に重要です。主要な指標には、平均適合率 (mAP)、和集合に対する積集合の比率 (IoU)、F1スコアがあります。これらの指標は、物体検出タスクの正解率と適合率の評価に役立ちます。これらの指標やモデルの改善方法について詳しくは、YOLOの性能指標ガイドをご覧ください。
Ultralytics Platformは、データセットのアノテーション、実験の追跡、クラウドトレーニング、エクスポート、YOLOモデル専用の推論エンドポイントを提供する、エンドツーエンドのノーコードワークスペースです。初心者からプロフェッショナルまで利用できます。
YOLOモデルのトレーニングでよく起きる問題には、データ形式のエラー、モデルアーキテクチャの不一致、トレーニングデータの不足などがあります。これらに対処するには、データセットが正しい形式であることを確認し、互換性のあるモデルバージョンを使用しているか確認して、トレーニングデータを拡張します。解決策の一覧については、YOLOでよくある問題ガイドをご覧ください。
NVIDIA JetsonやRaspberry PiなどのエッジデバイスにYOLOモデルをデプロイするには、TensorRTやLiteRTなどの互換形式にモデルを変換する必要があります。エッジハードウェアでリアルタイム物体検出を始めるには、NVIDIA JetsonとRaspberry Piへのデプロイ手順ガイドをご覧ください。これらのガイドでは、インストール、設定、性能最適化について説明します。
コメント30
質問したり、結果を共有したり、ほかの人をサポートしたりできます。
safdarhamid64-cpu
i have done everything using your docker method everything , using AI chatbots , but still i am unable to run the yolo , plzz provide me a solution that will work for every Raspberry Pi4 because its really so much frustrating
tutorialsyolo
Hi, I am trying to improve the convolutional layers in the nn module like in conv.py or block.py as novelty for my research. The location is like "ultralytics/ultralytics/nn/modules/conv.py. Could you please tell me where else i should update/call the new block which I improved? Because it gives me error when I am adding those blocks in the cfg/.yaml files for training in a custom dataset. Thank you
Ishfaz
Hello,
I'm using YOLOv8 for object detection, and I have only three classes in my dataset. However, when I generate the confusion matrix after training or validation, I notice that it shows a 4x4 matrix instead of the expected 3x3.
It seems like an extra class, possibly a "background" or "null" class, is being added automatically.
How can I remove this extra background class so that my confusion matrix only reflects the three actual classes I have trained on?
AashishThakur1321
can you tell the path, where downloaded model weights are stored as i manually want to add the weights to the folder as i don't have internet access on server
Glenn JocherUltralytics@AashishThakur1321 the default location where Ultralytics models are stored depends on your operating system, but it's typically within a directory in your user's home folder; you can find more specific details by checking the "Settings" section when you run
from ultralytics import settings; print(settings).1
ghost
Hello, I am working on a project to detect different types of cells. I already have a trained model, thanks to Ultralytics! I want to increase my dataset and tried using the auto-annotate function. The function works well but annotates objects in polygons. I need annotation in rectangular bounding boxes. Can you please help with this problem? https://docs.ultralytics.com/reference/data/annotator/
Glenn JocherUltralytics@kartmyco thank you for your message! While the auto-annotate function currently outputs polygon annotations, you can convert them to rectangular bounding boxes using tools like
cvatorlabelme, or you can write a custom script to approximate polygons into rectangular boxes. For details on data annotation tools, you can refer to our guide on data collection and annotation. Let us know if you have additional questions!ghost
Hello Glenn, Thank you so much for your reply. I will try to approximate the polygons in rectangular bounding boxes.
jdonza
I decided to make a different thread here as it is related to a different topic. But I wanted to know if you guys had documentation that went into the specifics of how the YOLO models are created. I am interested to learn more about CNN's, how they work, and how it relates to the image processing of YOLO.
Glenn JocherUltralytics@jdonza for detailed information on how YOLO models are created and how CNNs work in relation to YOLO, please refer to our comprehensive guides at https://docs.ultralytics.com/guides/. These resources cover various aspects of YOLO, including its architecture and image processing techniques.
jdonza
Hello,
Are there any tutorials showing how to train a YOLOv8 model using multiple devices for faster training? I read the instructions for YOLOv5 but got a bit lost. Step by step instructions would be greatly appreciated!
Thank you!
Glenn JocherUltralytics@jdonza hello,
For training YOLOv8 using multiple devices, please refer to our Multi-GPU Training guide. It provides step-by-step instructions to help you set up and run training across multiple GPUs.
Thank you!
jdonza
Thank you for the response! What I am still confused with is the following line of code.
results = model.train(data="coco8.yaml", epochs=100, imgsz=640, device=[0, 1])Here are a few questions I had.
- I have one GPU on my computer currently. If I had another device that also had the same GPU, how does YOLO know which computer is 0 and which is 1? Is there a physical connection of some sort that needs to occur?
- If you had a computer with multiple GPU's, the same questions arises. How does YOLO know which is 0 and which is 1?
Overall, I am confused with the set-up steps that need to occur before simply inputting "device=[0,1]".
Sorry if my questions appear trivial. I am a beginner and do not have much experience with network configurations like this!
Thanks!
Glenn JocherUltralytics@jdonza to address your questions:
- YOLOv8 does not support multi-device training across different computers. Each device ID (e.g., 0, 1) refers to GPUs within the same machine.
- For a computer with multiple GPUs, device IDs are assigned based on the order in which GPUs are detected by the system. You can verify GPU IDs using
nvidia-smi.
For more details, please refer to the Multi-GPU Training guide.
jdonza
Was this capability eliminated? The link you provided has a drop-down section labeled "Use Multiple Machines" which appears to provide some sort of framework to accomplish this.
Glenn JocherUltralytics@jdonza the capability for multi-machine training is not supported in YOLOv8. The "Use Multiple Machines" section in the documentation you referenced may pertain to older versions or different contexts. For multi-GPU training on a single machine, you can use the
device=[0,1]argument. If you have further questions, please refer to the Multi-GPU Training guide.jdonza
Okay thank you!
Glenn JocherUltralytics@jdonza you're welcome! For training YOLOv8 on multiple GPUs within a single machine, you can use the
device=[0,1]argument. Each GPU is identified by its ID, which you can check usingnvidia-smi. Multi-machine training is not supported. For more details, please refer to the Multi-GPU Training guide.Ephraim-Bryski
While not supported in YOLOv8, I did see reference to training across multiple computers in the YOLOv5 documentation:
(I believe this is what jdonza was referring to before). Does this allow for training across multiple computers for YOLOv5, but is no longer supported in YOLOv8? If so, would using YOLOv5 instead of v8 be recommended for this use case? Thanks!
Glenn JocherUltralyticsTraining across multiple computers is supported in YOLOv5 using DistributedDataParallel, but this feature is not available in YOLOv8. If multi-machine training is essential for your use case, using YOLOv5 would be recommended. For more details, please refer to the YOLOv5 documentation.
TanWeeKang
hi, i am doing a project about food detection. the detection results were great. however, there are some overlapping bboxes for some categories of food. some input images will have this category and some will have others. how can i apply nms to retrieve only the highest conf score of the detection and remove overlapping bboxes? i run inference on my best.pt model by giving it input images
Glenn JocherUltralytics(編集済み)Hi there! It's great to hear that your food detection project is yielding excellent results! 🎉
To address the issue of overlapping bounding boxes, you can apply Non-Maximum Suppression (NMS) to retain only the highest confidence score detections and remove the overlapping ones. YOLO models typically handle NMS internally, but you can customize the NMS settings during inference to better suit your needs.
Here's how you can do it:
Using Python
If you're running inference in a Python environment, you can set the
conf(confidence threshold) andiou(IoU threshold for NMS) parameters when calling thepredictmethod. Here's an example:from ultralytics import YOLO # Load your custom-trained model model = YOLO('path/to/best.pt') # Run inference with custom NMS settings results = model.predict(source='path/to/your/image.jpg', conf=0.25, iou=0.45) # Display results results[0].show()Using CLI
If you're using the command line interface, you can specify these parameters directly in your command:
yolo predict model=path/to/best.pt source='path/to/your/image.jpg' conf=0.25 iou=0.45Explanation
conf: This sets the minimum confidence threshold for detections. Detections with a confidence score below this value will be discarded.iou: This sets the IoU threshold for NMS. Detections with an IoU greater than this value will be considered overlapping, and only the one with the highest confidence score will be kept.
For more detailed information on inference and NMS settings, you can refer to the YOLO Predict Documentation.
If you encounter any issues or need further assistance, please ensure you're using the latest versions of
torchandultralytics. If the problem persists, providing a minimum reproducible example would be very helpful. You can find guidelines on creating one here: Minimum Reproducible Example.Happy coding, and best of luck with your project! 🚀
TanWeeKang
because the goal for now is to remove overlapping, if i set the iou threshold on the high side, the image doesnt differ much from the original detected image, where there are many overlappings. if i set to a low iou threshold, more overlappings will be removed.
TanWeeKang
another thing is that for my food detection i have 5 classes/categories of food. under these 5 categories i have variety of food for each category, but i label and train the model on these 5 classes, for simplicity sake i did not go into detail about what kind of food is that, lets say meat we have fish, pork etc. the model see either of those and classify as meat. although they are from same classes, they might have different prices. now how can i use segmentation( maybe from opencv) to distinguish the image i used to run inference on my best.pt model to identify the difference in meat like fish, pork to have different prices?
Glenn JocherUltralytics(編集済み)Hi there! Thanks for reaching out and providing detailed feedback on your experience with overlapping bounding boxes in your food detection project. It's fantastic to hear that your detection results are generally great! 🎉
To address the issue of overlapping bounding boxes, adjusting the IoU threshold is indeed a key factor. Here’s a more refined approach to help you achieve the best balance:
Fine-Tuning IoU Threshold
- High IoU Threshold: Retains more overlapping boxes, which might be useful if you want to ensure that no potential detections are missed.
- Low IoU Threshold: Removes more overlapping boxes, which can help in reducing redundancy but might risk missing some detections.
Practical Steps
- Experiment with Intermediate Values: Instead of setting the IoU threshold to extremes, try intermediate values (e.g., 0.3, 0.4, 0.5) to find a sweet spot that minimizes overlaps without losing important detections.
- Confidence Threshold: Adjust the confidence threshold (
conf) to filter out low-confidence detections, which can also help in reducing overlaps.
Example Code
Here’s how you can apply these settings in Python:
from ultralytics import YOLO # Load your custom-trained model model = YOLO('path/to/best.pt') # Run inference with custom NMS settings results = model.predict(source='path/to/your/image.jpg', conf=0.25, iou=0.45) # Display results results[0].show()And using the CLI:
yolo predict model=path/to/best.pt source='path/to/your/image.jpg' conf=0.25 iou=0.45Additional Resources
For more detailed guidance on optimizing your model and handling common issues, you might find the following guides helpful:
If you continue to experience issues, please ensure you are using the latest versions of
torchandultralytics. If the problem persists, providing a minimum reproducible example would be very helpful. You can find guidelines on creating one here: Minimum Reproducible Example.Feel free to reach out if you have any more questions or need further assistance. Happy coding! 🚀
TanWeeKang
another thing is that for my food detection i have 5 classes/categories of food. under these 5 categories i have variety of food for each category, but i label and train the model on these 5 classes, for simplicity sake i did not go into detail about what kind of food is that, lets say meat we have fish, pork etc. the model see either of those and classify as meat. although they are from same classes, they might have different prices. now how can i use segmentation( maybe from opencv) to distinguish the image i used to run inference on my best.pt model to identify the difference in meat like fish, pork to have different prices?
Glenn JocherUltralyticsHi there! It's fantastic to hear about your progress with food detection using YOLO. 😊
To distinguish between different types of food within the same category (like fish and pork under "meat"), you can leverage segmentation techniques. Here's a step-by-step approach to achieve this:
1. Segmentation with OpenCV
You can use OpenCV to perform image segmentation, which will help you isolate different types of food within the same category. Here's a basic example of how you might use OpenCV for segmentation:
import cv2 import numpy as np # Load the image image = cv2.imread('path/to/your/image.jpg') # Convert to grayscale gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) # Apply GaussianBlur to reduce noise and improve contour detection blurred = cv2.GaussianBlur(gray, (5, 5), 0) # Use Canny edge detection edges = cv2.Canny(blurred, 50, 150) # Find contours contours, _ = cv2.findContours(edges, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) # Draw contours on the original image cv2.drawContours(image, contours, -1, (0, 255, 0), 2) # Display the result cv2.imshow('Segmented Image', image) cv2.waitKey(0) cv2.destroyAllWindows()2. Combining YOLO Detection with Segmentation
You can combine the bounding boxes from your YOLO model with segmentation to further classify the detected objects. Here’s a conceptual approach:
- Run YOLO Inference: Use your trained YOLO model to detect the general categories (e.g., meat).
- Apply Segmentation: Within each detected bounding box, apply segmentation to isolate different types of food.
- Classify Segmented Regions: Use additional classification models or heuristics to distinguish between types like fish and pork.
3. Advanced Segmentation Techniques
For more precise segmentation, consider using advanced models like Mask R-CNN or leveraging pre-trained segmentation models available in frameworks like PyTorch or TensorFlow.
Example with YOLO and Segmentation
Here’s a more integrated example combining YOLO detection with OpenCV segmentation:
from ultralytics import YOLO import cv2 # Load your custom-trained YOLO model model = YOLO('path/to/best.pt') # Run inference results = model.predict(source='path/to/your/image.jpg', conf=0.25, iou=0.45) # Process each detected bounding box for result in results: for box in result.boxes: x1, y1, x2, y2 = map(int, box.xyxy[0]) cropped_img = result.orig_img[y1:y2, x1:x2] # Convert to grayscale and apply segmentation gray = cv2.cvtColor(cropped_img, cv2.COLOR_BGR2GRAY) blurred = cv2.GaussianBlur(gray, (5, 5), 0) edges = cv2.Canny(blurred, 50, 150) contours, _ = cv2.findContours(edges, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) cv2.drawContours(cropped_img, contours, -1, (0, 255, 0), 2) # Display the segmented image cv2.imshow('Segmented Image', cropped_img) cv2.waitKey(0) cv2.destroyAllWindows()Further Reading
For more detailed guides and advanced techniques, you might find these resources helpful:
Feel free to experiment with these techniques and adjust the parameters to better suit your specific use case. If you have any more questions or need further assistance, don't hesitate to ask. Happy coding! 🚀
thisisqiuqiuqiu
Thank you very much for your letter. Your reply is very helpful to my experimental training. I understand how to set up the basic model training. I wish you all success in your future work.
------------------ 原始邮件 ------------------ 发件人: "ultralytics/ultralytics" @.>; 发送时间: 2024年5月20日(星期一) 中午12:11 @.>; @.@.>; 主题: Re: [ultralytics/ultralytics] zh/guides/ (Discussion #12787)
Hello! The number of epochs needed for training the YOLOv8 base model can vary depending on your specific dataset and the complexity of the task. While 500 epochs might be necessary for some scenarios to achieve optimal results, it's not a strict requirement for all cases.
A good practice is to monitor the training process for signs of convergence, such as stable validation loss and accuracy metrics. You can start with fewer epochs, like 100 or 200, and evaluate the model's performance. If the results are not satisfactory, you can continue training for more epochs or consider adjusting other hyperparameters.
Here's a simple example to start training with a specified number of epochs: yolo train data=coco128.yaml model=yolov8n.pt epochs=100
Adjust the epochs value as needed based on your observations. Happy training! 😊
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
thisisqiuqiuqiu
I would like to ask, does the yolov8 base model need to be trained to 500 epochs?
Glenn JocherUltralytics(編集済み)Hello! The number of epochs needed for training the YOLO base model can vary depending on your specific dataset and the complexity of the task. While 500 epochs might be necessary for some scenarios to achieve optimal results, it's not a strict requirement for all cases.
A good practice is to monitor the training process for signs of convergence, such as stable validation loss and accuracy metrics. You can start with fewer epochs, like 100 or 200, and evaluate the model's performance. If the results are not satisfactory, you can continue training for more epochs or consider adjusting other hyperparameters.
Here's a simple example to start training with a specified number of epochs:
yolo train data=coco128.yaml model=yolo26n.pt epochs=100Adjust the
epochsvalue as needed based on your observations. Happy training! 😊