ultralytics / ultralytics

NEW - YOLOv8 🚀 in PyTorch > ONNX > OpenVINO > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
23.76k stars 4.74k forks source link

I just start to learn how to use yolov8. I don'know why the map is so low,and I don'know how to solve the problem.T-T. #11692

Open qiaopidekoudai opened 1 week ago

qiaopidekoudai commented 1 week ago

Search before asking

Question

Snipaste_2024-05-06_21-28-39

Additional

My custom data sets have 890 images.Use yolov8x-oiv7.pt as the pretrained weight.

github-actions[bot] commented 1 week ago

👋 Hello @qiaopidekoudai, thank you for your interest in Ultralytics YOLOv8 🚀! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.

Install

Pip install the ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.

pip install ultralytics

Environments

YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

glenn-jocher commented 1 week ago

Hey there! I'm glad to see you're exploring YOLOv8! 🌟 It sounds like the mAP (mean Average Precision) being lower than expected could be influenced by a few factors. Here are some suggestions:

  1. Adequate Data: Ensure your dataset is diverse and representative of the scenarios you expect the model to handle in deployment. With 890 images, also check if the distribution among classes is balanced.

  2. Training Epochs: Sometimes, the model may need more epochs to learn effectively, especially with smaller datasets. Consider increasing the number of epochs.

  3. Pretrained Weights: Using yolov8x-oiv7.pt is a good start. Just confirm that the model architecture matches the complexity of your dataset well. For some cases, a simpler or more complex model might be necessary.

  4. Annotation Quality: Double-check if the bounding boxes are correctly labeled. Poor annotations can significantly affect model performance.

  5. Hyperparameter Tuning: Tweaking the learning rate, batch size, or other hyperparameters can sometimes yield better results.

Here's an example snippet to adjust training parameters:

from ultralytics import YOLO

# Load YOLO model with custom config and pretrained weights
model = YOLO('path_to_yolov8x-oiv7.yaml').load('path_to_yolov8x-oiv7.pt')

# Train with custom dataset, extended epochs and adjusted image size
results = model.train(data='custom_dataset.yaml', epochs=200, imgsz=640)

Feel free to share more details if these adjustments don't help, or if there's anything else specific you were concerned about! 😊