From e5d3427a5282a817c5b91478e39ac17871827fe5 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 5 Oct 2024 00:15:48 +0200 Subject: [PATCH] Zero mAP warning on YAML val (#16698) --- ultralytics/engine/validator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ultralytics/engine/validator.py b/ultralytics/engine/validator.py index 5e0f0988c5..ff04a85135 100644 --- a/ultralytics/engine/validator.py +++ b/ultralytics/engine/validator.py @@ -119,6 +119,8 @@ class BaseValidator: self.args.plots &= trainer.stopper.possible_stop or (trainer.epoch == trainer.epochs - 1) model.eval() else: + if Path(self.args.model).suffix == ".yaml": + LOGGER.warning("WARNING ⚠️ validating an untrained model YAML will result in 0 mAP.") callbacks.add_integration_callbacks(self) model = AutoBackend( weights=model or self.args.model,