From 1a26e1e195ef89ad79d37761e5a1524de29b42ba Mon Sep 17 00:00:00 2001 From: John-Henry Lim <42513874+Interpause@users.noreply.github.com> Date: Sun, 28 May 2023 22:36:47 +0800 Subject: [PATCH] kwargs override `cfg` argument in model.train (#2839) (#2853) Co-authored-by: Glenn Jocher --- ultralytics/yolo/engine/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultralytics/yolo/engine/model.py b/ultralytics/yolo/engine/model.py index eca2dde6d7..245663827d 100644 --- a/ultralytics/yolo/engine/model.py +++ b/ultralytics/yolo/engine/model.py @@ -353,10 +353,10 @@ class YOLO: kwargs = self.session.train_args check_pip_update_available() overrides = self.overrides.copy() - overrides.update(kwargs) if kwargs.get('cfg'): LOGGER.info(f"cfg file passed. Overriding default params with {kwargs['cfg']}.") overrides = yaml_load(check_yaml(kwargs['cfg'])) + overrides.update(kwargs) overrides['mode'] = 'train' if not overrides.get('data'): raise AttributeError("Dataset required but missing, i.e. pass 'data=coco128.yaml'")