Allow custom` --evolve` project names (#6567)
Browse files* Update train.py
As see in #6463, modification on train in evolve process to allow custom save directory.
* fix val
* PEP8
whitespace around operator
* Cleanup
Co-authored-by: Glenn Jocher <[email protected]>
train.py
CHANGED
@@ -515,7 +515,8 @@ def main(opt, callbacks=Callbacks()):
|
|
515 |
check_file(opt.data), check_yaml(opt.cfg), check_yaml(opt.hyp), str(opt.weights), str(opt.project) # checks
|
516 |
assert len(opt.cfg) or len(opt.weights), 'either --cfg or --weights must be specified'
|
517 |
if opt.evolve:
|
518 |
-
opt.project
|
|
|
519 |
opt.exist_ok, opt.resume = opt.resume, False # pass resume to exist_ok and disable resume
|
520 |
opt.save_dir = str(increment_path(Path(opt.project) / opt.name, exist_ok=opt.exist_ok))
|
521 |
|
|
|
515 |
check_file(opt.data), check_yaml(opt.cfg), check_yaml(opt.hyp), str(opt.weights), str(opt.project) # checks
|
516 |
assert len(opt.cfg) or len(opt.weights), 'either --cfg or --weights must be specified'
|
517 |
if opt.evolve:
|
518 |
+
if opt.project == str(ROOT / 'runs/train'): # if default project name, rename to runs/evolve
|
519 |
+
opt.project = str(ROOT / 'runs/evolve')
|
520 |
opt.exist_ok, opt.resume = opt.resume, False # pass resume to exist_ok and disable resume
|
521 |
opt.save_dir = str(increment_path(Path(opt.project) / opt.name, exist_ok=opt.exist_ok))
|
522 |
|