ultralytics / yolov5

YOLOv5 πŸš€ in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.41k stars 16.27k forks source link

How to training with EMA in model.train()? #13320

Closed htwang14 closed 1 month ago

htwang14 commented 1 month ago

Search before asking

Question

Hi, I trained the yolo model using model.train(data="coco8.yaml", epochs=100, imgsz=640) and everything worked fine. I suppose the above code is not applying EMA, right? Could you please show me how to apply EMA during training using the model.train function?

I've checked your code demo here. But it is not implemented with the model.train. Thank you in advance!

Additional

No response

UltralyticsAssistant commented 1 month ago

πŸ‘‹ Hello @htwang14, thank you for reaching out and for using YOLOv5 πŸš€!

To get started on your EMA-related query, I recommend reviewing our ⭐️ Tutorials which provide comprehensive guides, including information on advanced training methods.

If your inquiry is a πŸ› Bug Report, please share a minimum reproducible example to help us diagnose the issue more effectively.

For custom training questions, such as applying EMA, provide additional details on your setup and confirm you’re following Tips for Best Training Results.

Requirements

Ensure you have Python>=3.8.0 and all dependencies from requirements.txt installed, including PyTorch>=1.8. Begin with:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 can be run in these verified environments with all necessary dependencies:

Status

Green badges indicate passing Continuous Integration (CI) tests for YOLOv5 training, validation, inference, export, and benchmarks across platforms.

Introducing YOLOv8 πŸš€

Be sure to check out the latest YOLOv8 for enhanced capabilities in object detection, segmentation, and classification. Head to YOLOv8 Docs and start with:

pip install ultralytics

This is an automated response, but rest assured, an Ultralytics engineer will follow up to assist you shortly 😊.

htwang14 commented 1 month ago

The issue is more related with the ultralytics repo instead of yolov5. I've opened the same question there and closed this one. Thanks!

glenn-jocher commented 1 month ago

@htwang14 thank you for the update. If you need further assistance, feel free to reach out on the Ultralytics repo.