Rename evolve folder if default project name (#11108)

Save logs to 'runs/evolve-seg' if default project name, 'runs/train-seg'

Signed-off-by: Iker Lluvia <iker.lluvia@tekniker.es>
pull/11109/head
Iker Lluvia 2023-03-06 22:54:34 +01:00 committed by GitHub
parent 5c91daeaec
commit 85f6019e5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -530,8 +530,8 @@ def main(opt, callbacks=Callbacks()):
check_file(opt.data), check_yaml(opt.cfg), check_yaml(opt.hyp), str(opt.weights), str(opt.project) # checks
assert len(opt.cfg) or len(opt.weights), 'either --cfg or --weights must be specified'
if opt.evolve:
if opt.project == str(ROOT / 'runs/train'): # if default project name, rename to runs/evolve
opt.project = str(ROOT / 'runs/evolve')
if opt.project == str(ROOT / 'runs/train-seg'): # if default project name, rename to runs/evolve-seg
opt.project = str(ROOT / 'runs/evolve-seg')
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