From e4f7458d907bb7c5009a3c86b27d3167be72191d Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 7 Nov 2022 00:52:08 +0100 Subject: [PATCH] Hydra *.yml extension deprecated fix (#34) --- ultralytics/yolo/engine/trainer.py | 2 +- ultralytics/yolo/utils/configs/{default.yml => default.yaml} | 0 ultralytics/yolo/v8/classify/train.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename ultralytics/yolo/utils/configs/{default.yml => default.yaml} (100%) diff --git a/ultralytics/yolo/engine/trainer.py b/ultralytics/yolo/engine/trainer.py index 4bf6947..3693fea 100644 --- a/ultralytics/yolo/engine/trainer.py +++ b/ultralytics/yolo/engine/trainer.py @@ -24,7 +24,7 @@ from ultralytics.yolo.utils import LOGGER, ROOT from ultralytics.yolo.utils.files import increment_path, save_yaml from ultralytics.yolo.utils.modeling import get_model -DEFAULT_CONFIG = ROOT / "yolo/utils/configs/default.yml" +DEFAULT_CONFIG = ROOT / "yolo/utils/configs/default.yaml" class BaseTrainer: diff --git a/ultralytics/yolo/utils/configs/default.yml b/ultralytics/yolo/utils/configs/default.yaml similarity index 100% rename from ultralytics/yolo/utils/configs/default.yml rename to ultralytics/yolo/utils/configs/default.yaml diff --git a/ultralytics/yolo/v8/classify/train.py b/ultralytics/yolo/v8/classify/train.py index 89c7041..527b8e4 100644 --- a/ultralytics/yolo/v8/classify/train.py +++ b/ultralytics/yolo/v8/classify/train.py @@ -47,7 +47,7 @@ class ClassificationTrainer(BaseTrainer): return torch.nn.functional.cross_entropy(preds, targets) -@hydra.main(version_base=None, config_path=DEFAULT_CONFIG.parent, config_name=DEFAULT_CONFIG.stem) +@hydra.main(version_base=None, config_path=DEFAULT_CONFIG.parent, config_name=DEFAULT_CONFIG.name) def train(cfg): cfg.model = cfg.model or "resnet18" cfg.data = cfg.data or "imagenette160" # or yolo.ClassificationDataset("mnist")