Skip to content

Commit 78fc024

Browse files
authored
DDP nl fix (ultralytics#5332)
1 parent 424934d commit 78fc024

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
246246
model = DDP(model, device_ids=[LOCAL_RANK], output_device=LOCAL_RANK)
247247

248248
# Model parameters
249-
nl = model.model[-1].nl # number of detection layers (to scale hyps)
249+
nl = de_parallel(model).model[-1].nl # number of detection layers (to scale hyps)
250250
hyp['box'] *= 3. / nl # scale to layers
251251
hyp['cls'] *= nc / 80. * 3. / nl # scale to classes and layers
252252
hyp['obj'] *= (imgsz / 640) ** 2 * 3. / nl # scale to image size and layers

0 commit comments

Comments
 (0)