From 834489e954d985be1b72518e3f61f6ad3fe27d1c Mon Sep 17 00:00:00 2001 From: unknown <2660417142@qq.com> Date: Thu, 17 Oct 2024 16:20:30 +0800 Subject: [PATCH] fix loss hyps --- train.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/train.py b/train.py index bcc1957c..09674cd2 100644 --- a/train.py +++ b/train.py @@ -189,11 +189,9 @@ def train(args): eval_dataset, eval_dataloader = None, None # Scale loss hyps - nl = len(args.network.anchors) - args.loss.box *= 3 / nl # scale to layers - args.loss.cls *= args.data.nc / 80 * 3 / nl # scale to classes and layers + args.loss.cls *= args.data.nc / 80 # scale to classes and layers if hasattr(args.loss, "obj"): - args.loss.obj *= (args.img_size / 640) ** 2 * 3 / nl # scale to image size and layers + args.loss.obj *= (args.img_size / 640) ** 2 # scale to image size and layers # Create Loss loss_fn = create_loss(