From ad658554d305bdd91ad60054adc03955dbbb753c Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 4 Mar 2024 18:32:13 +0100 Subject: [PATCH] Add settings `runs_dir` == `datasets_dir` warning (#8653) Signed-off-by: Glenn Jocher --- docs/en/models/yolov9.md | 17 ++++++++--------- ultralytics/utils/__init__.py | 16 +++++++++++++--- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/docs/en/models/yolov9.md b/docs/en/models/yolov9.md index 3252c1d0b0..51ddfff8a4 100644 --- a/docs/en/models/yolov9.md +++ b/docs/en/models/yolov9.md @@ -58,12 +58,12 @@ The performance of YOLOv9 on the [COCO dataset](../datasets/detect/coco.md) exem **Table 1. Comparison of State-of-the-Art Real-Time Object Detectors** -| Model | size
(pixels) | APval
50-95 | APval
50 | APval
75 | params
(M) | FLOPs
(B) | -|----------|-----------------------|---------------------|------------------|------------------|--------------------|-------------------| -| YOLOv9-S | 640 | 46.8 | 63.4 | 50.7 | 7.2 | 26.7 | -| YOLOv9-M | 640 | 51.4 | 68.1 | 56.1 | 20.1 | 76.8 | -| YOLOv9-C | 640 | 53.0 | 70.2 | 57.8 | 25.5 | 102.8 | -| YOLOv9-E | 640 | 55.6 | 72.8 | 60.6 | 58.1 | 192.5 | +| Model | size
(pixels) | APval
50-95 | APval
50 | APval
75 | params
(M) | FLOPs
(B) | +|---------------------------------------------------------------------------------------|-----------------------|---------------------|------------------|------------------|--------------------|-------------------| +| YOLOv9-S | 640 | 46.8 | 63.4 | 50.7 | 7.2 | 26.7 | +| YOLOv9-M | 640 | 51.4 | 68.1 | 56.1 | 20.1 | 76.8 | +| [YOLOv9-C](https://github.com/ultralytics/assets/releases/download/v8.1.0/yolov9c.pt) | 640 | 53.0 | 70.2 | 57.8 | 25.5 | 102.8 | +| [YOLOv9-E](https://github.com/ultralytics/assets/releases/download/v8.1.0/yolov9e.pt) | 640 | 55.6 | 72.8 | 60.6 | 58.1 | 192.5 | YOLOv9's iterations, ranging from the smaller S variant to the extensive E model, demonstrate improvements not only in accuracy (AP metrics) but also in efficiency with a reduced number of parameters and computational needs (FLOPs). This table underscores YOLOv9's ability to deliver high precision while maintaining or reducing the computational overhead compared to prior versions and competing models. @@ -80,7 +80,6 @@ These results showcase YOLOv9's strategic advancements in model design, emphasiz YOLOv9 represents a pivotal development in real-time object detection, offering significant improvements in terms of efficiency, accuracy, and adaptability. By addressing critical challenges through innovative solutions like PGI and GELAN, YOLOv9 sets a new precedent for future research and application in the field. As the AI community continues to evolve, YOLOv9 stands as a testament to the power of collaboration and innovation in driving technological progress. - ## Usage Examples This example provides simple YOLOv9 training and inference examples. For full documentation on these and other [modes](../modes/index.md) see the [Predict](../modes/predict.md), [Train](../modes/train.md), [Val](../modes/val.md) and [Export](../modes/export.md) docs pages. @@ -128,8 +127,8 @@ The YOLOv9 series offers a range of models, each optimized for high-performance | Model Type | Pre-trained Weights | Tasks Supported | Inference | Validation | Training | Export | |------------|-----------------------------------------------------------------------------------------|----------------------------------------|-----------|------------|----------|--------| -| YOLOv9-C | [yolov9c.pt](https://github.com/ultralytics/assets/releases/download/v8.1.0/yolov9c.pt) | [Object Detection](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ | -| YOLOv9-E | [yolov9e.pt](https://github.com/ultralytics/assets/releases/download/v8.1.0/yolov9e.pt) | [Object Detection](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ | +| YOLOv9-C | [yolov9c.pt](https://github.com/ultralytics/assets/releases/download/v8.1.0/yolov9c.pt) | [Object Detection](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ | +| YOLOv9-E | [yolov9e.pt](https://github.com/ultralytics/assets/releases/download/v8.1.0/yolov9e.pt) | [Object Detection](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ | This table provides a detailed overview of the YOLOv9 model variants, highlighting their capabilities in object detection tasks and their compatibility with various operational modes such as [Inference](../modes/predict.md), [Validation](../modes/val.md), [Training](../modes/train.md), and [Export](../modes/export.md). This comprehensive support ensures that users can fully leverage the capabilities of YOLOv9 models in a broad range of object detection scenarios. diff --git a/ultralytics/utils/__init__.py b/ultralytics/utils/__init__.py index ddc9ba3f89..4d1e952109 100644 --- a/ultralytics/utils/__init__.py +++ b/ultralytics/utils/__init__.py @@ -958,15 +958,25 @@ class SettingsManager(dict): correct_keys = self.keys() == self.defaults.keys() correct_types = all(type(a) is type(b) for a, b in zip(self.values(), self.defaults.values())) correct_version = check_version(self["settings_version"], self.version) + help_msg = ( + f"\nView settings with 'yolo settings' or at '{self.file}'" + "\nUpdate settings with 'yolo settings key=value', i.e. 'yolo settings runs_dir=path/to/dir'. " + "For help see https://docs.ultralytics.com/quickstart/#ultralytics-settings." + ) if not (correct_keys and correct_types and correct_version): LOGGER.warning( "WARNING ⚠️ Ultralytics settings reset to default values. This may be due to a possible problem " - "with your settings or a recent ultralytics package update. " - f"\nView settings with 'yolo settings' or at '{self.file}'" - "\nUpdate settings with 'yolo settings key=value', i.e. 'yolo settings runs_dir=path/to/dir'." + f"with your settings or a recent ultralytics package update. {help_msg}" ) self.reset() + if self.get("datasets_dir") == self.get("runs_dir"): + LOGGER.warning( + f"WARNING ⚠️ Ultralytics setting 'datasets_dir: {self.get('datasets_dir')}' " + f"must be different than 'runs_dir: {self.get('runs_dir')}'. " + f"Please change one to avoid possible issues during training. {help_msg}" + ) + def load(self): """Loads settings from the YAML file.""" super().update(yaml_load(self.file))