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: Glenn Jocher <glenn.jocher@ultralytics.com>pull/8902/head
parent
48a85314bc
commit
c962db2749
2
train.py
2
train.py
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue