Unverified 提交 621b6d5b authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Evolution `--resume` fix (#4802)

Also disable `/weights` dir creation when evolving as no weights are saved and empty folder causes user expectations of weights.
上级 b74dd4ba
......@@ -64,7 +64,7 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
# Directories
w = save_dir / 'weights' # weights dir
w.mkdir(parents=True, exist_ok=True) # make dir
(w.parent if evolve else w).mkdir(parents=True, exist_ok=True) # make dir
last, best = w / 'last.pt', w / 'best.pt'
# Hyperparameters
......@@ -489,7 +489,7 @@ def main(opt, callbacks=Callbacks()):
assert len(opt.cfg) or len(opt.weights), 'either --cfg or --weights must be specified'
if opt.evolve:
opt.project = 'runs/evolve'
opt.exist_ok = opt.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))
# DDP mode
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论