Skip to content

Commit

Permalink
Add train.py --name cfg option (ultralytics#7202)
Browse files Browse the repository at this point in the history
Automatically names run as --cfg argument
  • Loading branch information
glenn-jocher committed Mar 31, 2022
1 parent 39c6e56 commit 2a0ad55
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2a0ad55

Please sign in to comment.