From 6e063cc52989310d8977bba95f2962429e8bca81 Mon Sep 17 00:00:00 2001 From: Joshua Friedrich Date: Tue, 13 Apr 2021 17:04:02 +0200 Subject: [PATCH] log fitrness --- train.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/train.py b/train.py index 61c77155da61..1c522864eaa6 100644 --- a/train.py +++ b/train.py @@ -407,21 +407,21 @@ def train(hyp, opt, device, tb_writer=None): os.system('gsutil cp %s gs://%s/results/results%s.txt' % (results_file, opt.bucket, opt.name)) # Log - # fi = fitness(np.array(results).reshape(1, -1)) # weighted combination of [P, R, mAP@.5, mAP@.5-.95] + fi = fitness(np.array(results).reshape(1, -1)) # weighted combination of [P, R, mAP@.5, mAP@.5-.95] tags = ['train/box_loss', 'train/obj_loss', 'train/cls_loss', # train loss 'metrics/precision', 'metrics/recall', 'metrics/mAP_0.5', 'metrics/mAP_0.5:0.95', 'val/box_loss', 'val/obj_loss', 'val/cls_loss', # val loss - 'x/lr0', 'x/lr1', 'x/lr2'] - # 'metrics/fitness' - # ] # params - for x, tag in zip(list(mloss[:-1]) + list(results) + lr, tags): # + list(fi), tags): + 'x/lr0', 'x/lr1', 'x/lr2', # ] + 'metrics/fitness', + ] # params + for x, tag in zip(list(mloss[:-1]) + list(results) + lr + list(fi), tags): # + list(fi), tags): if tb_writer: tb_writer.add_scalar(tag, x, epoch) # tensorboard if wandb_logger.wandb: wandb_logger.log({tag: x}) # W&B # Update best mAP - fi = fitness(np.array(results).reshape(1, -1)) # weighted combination of [P, R, mAP@.5, mAP@.5-.95] + # fi = fitness(np.array(results).reshape(1, -1)) # weighted combination of [P, R, mAP@.5, mAP@.5-.95] if fi > best_fitness: best_fitness = fi wandb_logger.end_epoch(best_result=best_fitness == fi)