Unverified 提交 8930e22c authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Evolution commented `hyp['anchors']` fix (#3887)

Fix for `KeyError: 'anchors'` error when start hyperparameter evolution: ```bash python train.py --evolve ``` ```bash Traceback (most recent call last): File "E:\yolov5\train.py", line 623, in <module> hyp[k] = max(hyp[k], v[1]) # lower limit KeyError: 'anchors' ```
上级 3c3f8fbd
......@@ -596,6 +596,8 @@ def main(opt):
with open(opt.hyp) as f:
hyp = yaml.safe_load(f) # load hyps dict
if 'anchors' not in hyp: # anchors commented in hyp.yaml
hyp['anchors'] = 3
assert LOCAL_RANK == -1, 'DDP mode not implemented for --evolve'
opt.notest, opt.nosave = True, True # only test/save final epoch
# ei = [isinstance(x, (int, float)) for x in hyp.values()] # evolvable indices
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论