Unverified 提交 c962db27 authored 作者: 黄不盈's avatar 黄不盈 提交者: GitHub

Fix anchor incorrectly initialized (#8891)

* Fix anchor incorrectly initialized Using --noautoanchor and --evolve simultaneously leads to anchor incorrectly initialized. --noautoanchor denotes anchors don't need to evolve, thus removing anchors from hyp will fix it. * Update train.py * Update train.py Co-authored-by: 's avatarGlenn Jocher <glenn.jocher@ultralytics.com>
上级 48a85314
......@@ -569,6 +569,8 @@ def main(opt, callbacks=Callbacks()):
hyp = yaml.safe_load(f) # load hyps dict
if 'anchors' not in hyp: # anchors commented in hyp.yaml
hyp['anchors'] = 3
if opt.noautoanchor:
del hyp['anchors'], meta['anchors']
opt.noval, opt.nosave, save_dir = True, True, Path(opt.save_dir) # only val/save final epoch
# ei = [isinstance(x, (int, float)) for x in hyp.values()] # evolvable indices
evolve_yaml, evolve_csv = save_dir / 'hyp_evolve.yaml', save_dir / 'evolve.csv'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论