Replies: 1 comment
-
@noel077 hello there! The difference between Using On the other hand, Regarding validation, The presence of multiple validation functions in the source code reflects the different layers of abstraction provided by the API. Each serves a different purpose depending on whether you're using the high-level or low-level API. For your use case, where you want to train with several parameters and a custom Remember, there's no one-size-fits-all answer; the best approach depends on your familiarity with the framework, your specific requirements, and how much control you need over the training and validation processes. 🚀 Happy training! |
Beta Was this translation helpful? Give feedback.
-
Hi community,
I am refering to the docs (https://docs.ultralytics.com/usage/python/).
In the section "Train" the training is accoomplished in a simple way:
model = YOLO('yolov8n.pt') # pass any model type
model.train(epochs=5)
Whereas in the section "Using Trainers" the training is done in a completely different manner:
trainer = DetectionTrainer(overrides={})
trainer.train()
trained_model = trainer.best
Especially when it comes to the validation, I don't really understand the two different approaches. For the first one, we can simply use:
model.val()
whereas for the second approach it is necessary to create a new Validator:
val = DetectionValidator(args=...)
val(model=trained_model)
Looking at the source code, there is a
def val
inultralytics.yolo.v8.detect.val.py
but also adef val
inultralytics.yolo.enginge.model.py
.Furhter there is a similar
def validate
inultalytics.yolo.engine.trainer.py
.I am getting really confused why there are several functions for validation.
I know this is a pretty basic question, but I would appreciate if someone could help me! Especially I am wondering what is the best approach in my use case. I want to perform the training with several parameters for which I will pass a custom cfg.yaml file.
Afterwards I want to perform a validation and obtain the bounding box loss.
Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions