Closed Vicks0712 closed 1 month ago
π Hello @Vicks0712, thank you for reaching out and bringing this to our attention π!
We suggest checking the Ultralytics Docs for a wealth of examples and guidance, especially around custom training and usage with different components.
If this is a π Bug Report, please ensure to provide a detailed minimum reproducible example (MRE), which you've done a great job with! This will help us further diagnose the issue.
For custom training β questions, ensure that your dataset and the model's configuration align with our Tips for Best Training Results.
Join the vibrant Ultralytics community for real-time discussions on Discord π§, explore detailed topics on Discourse, or engage on our Subreddit.
Make sure your ultralytics
package is up-to-date, alongside all requirements, within a Python>=3.8 environment and using PyTorch>=1.8.
pip install -U ultralytics
Run your model in any of the following environments with all dependencies preinstalled:
A green status indicates all Ultralytics CI tests are passing, ensuring correct operations across MAC, Windows, and Ubuntu.
This is an automated response, but rest assured, an Ultralytics engineer will assist you shortly. Thanks for your patience! π
Marking as duplicate of https://github.com/ultralytics/ultralytics/issues/16189
You can use the existing issue. Thanks.
Search before asking
Ultralytics YOLO Component
No response
Bug
Hello https://github.com/ultralytics team,
I am trying to train the Yolov8 model with a more customized trainer, instead of using the one provided by the default library. I'm trying to reproduce the loss calculation for this model using the v8DetectionLoss class, but it always gives this same error:
And I think it comes from this part of the code in v8DetectionLoss class, in utils/loss.py:
This is how I'm loading the yolov8 detection model and the loss function:
Environment
Ultralytics YOLOv8.1.34 π Python-3.11.8 torch-2.4.0+cu124 CUDA:0 (NVIDIA GeForce GTX 1650, 4096MiB) Setup complete β (12 CPUs, 15.9 GB RAM, 719.3/952.6 GB disk)
Minimal Reproducible Example
Dataset.py
Dataloader.py:
Trainer.py:
Additional
"Many thanks in advance to the @ultralytics team!!!"
Are you willing to submit a PR?