From df9008ee69cac78524cc84500c7fc282a1a1d4bd Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 31 Mar 2022 13:17:22 +0200 Subject: [PATCH] Add train.py `--name cfg` option (#7202) Automatically names run as --cfg argument --- train.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/train.py b/train.py index 60be962d447f..36a0e7a7ba66 100644 --- a/train.py +++ b/train.py @@ -519,6 +519,8 @@ def main(opt, callbacks=Callbacks()): if opt.project == str(ROOT / 'runs/train'): # if default project name, rename to runs/evolve opt.project = str(ROOT / 'runs/evolve') opt.exist_ok, opt.resume = opt.resume, False # pass resume to exist_ok and disable resume + if opt.name == 'cfg': + opt.name = Path(opt.cfg).stem # use model.yaml as name opt.save_dir = str(increment_path(Path(opt.project) / opt.name, exist_ok=opt.exist_ok)) # DDP mode