Browse Source

Allow custom` --evolve` project names (#6567)

* 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 <glenn.jocher@ultralytics.com>
modifyDataloader
Matthias Vadcard GitHub 2 years ago
parent
commit
f40854b61b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      train.py

+ 2
- 1
train.py View File

check_file(opt.data), check_yaml(opt.cfg), check_yaml(opt.hyp), str(opt.weights), str(opt.project) # checks 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' assert len(opt.cfg) or len(opt.weights), 'either --cfg or --weights must be specified'
if opt.evolve: if opt.evolve:
opt.project = str(ROOT / 'runs/evolve')
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 opt.exist_ok, opt.resume = opt.resume, False # pass resume to exist_ok and disable resume
opt.save_dir = str(increment_path(Path(opt.project) / opt.name, exist_ok=opt.exist_ok)) opt.save_dir = str(increment_path(Path(opt.project) / opt.name, exist_ok=opt.exist_ok))



Loading…
Cancel
Save