From a4fece8c1480aed46a38a6344b403d79c81bd751 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 25 Oct 2021 16:03:39 +0200 Subject: [PATCH] DDP `nl` fix (#5332) --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index d83f3cd..292f2da 100644 --- a/train.py +++ b/train.py @@ -246,7 +246,7 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary model = DDP(model, device_ids=[LOCAL_RANK], output_device=LOCAL_RANK) # Model parameters - nl = model.model[-1].nl # number of detection layers (to scale hyps) + nl = de_parallel(model).model[-1].nl # number of detection layers (to scale hyps) hyp['box'] *= 3. / nl # scale to layers hyp['cls'] *= nc / 80. * 3. / nl # scale to classes and layers hyp['obj'] *= (imgsz / 640) ** 2 * 3. / nl # scale to image size and layers