From ea05d5cb6c0dc01ef254761f0b140ceab17f9fd3 Mon Sep 17 00:00:00 2001 From: Iker Lluvia Date: Thu, 9 Mar 2023 23:47:53 +0100 Subject: [PATCH] Correct mutation adding the missing parameters (#11109) * Correct mutation adding the missing parameters Correct mutation considering the higher number of segmentation parameters compared to object detection. Fixes #9730 Signed-off-by: Iker Lluvia * Use already defined segmentation keys from segment/metrics.py --------- Signed-off-by: Iker Lluvia Co-authored-by: Glenn Jocher --- segment/train.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/segment/train.py b/segment/train.py index c6ac2d5e23d2..8ed75ba63e7c 100644 --- a/segment/train.py +++ b/segment/train.py @@ -629,7 +629,7 @@ def main(opt, callbacks=Callbacks()): while all(v == 1): # mutate until a change occurs (prevent duplicates) v = (g * (npr.random(ng) < mp) * npr.randn(ng) * npr.random() * s + 1).clip(0.3, 3.0) for i, k in enumerate(hyp.keys()): # plt.hist(v.ravel(), 300) - hyp[k] = float(x[i + 7] * v[i]) # mutate + hyp[k] = float(x[i + 12] * v[i]) # mutate # Constrain to limits for k, v in meta.items(): @@ -641,7 +641,7 @@ def main(opt, callbacks=Callbacks()): results = train(hyp.copy(), opt, device, callbacks) callbacks = Callbacks() # Write mutation results - print_mutation(KEYS, results, hyp.copy(), save_dir, opt.bucket) + print_mutation(KEYS[4:16], results, hyp.copy(), save_dir, opt.bucket) # Plot results plot_evolve(evolve_csv)