glenn-jocher commited on
Commit
a4fece8
1 Parent(s): 9c31a66

DDP `nl` fix (#5332)

Browse files
Files changed (1) hide show
  1. train.py +1 -1
train.py CHANGED
@@ -246,7 +246,7 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
246
  model = DDP(model, device_ids=[LOCAL_RANK], output_device=LOCAL_RANK)
247
 
248
  # Model parameters
249
- nl = model.model[-1].nl # number of detection layers (to scale hyps)
250
  hyp['box'] *= 3. / nl # scale to layers
251
  hyp['cls'] *= nc / 80. * 3. / nl # scale to classes and layers
252
  hyp['obj'] *= (imgsz / 640) ** 2 * 3. / nl # scale to image size and layers
 
246
  model = DDP(model, device_ids=[LOCAL_RANK], output_device=LOCAL_RANK)
247
 
248
  # Model parameters
249
+ nl = de_parallel(model).model[-1].nl # number of detection layers (to scale hyps)
250
  hyp['box'] *= 3. / nl # scale to layers
251
  hyp['cls'] *= nc / 80. * 3. / nl # scale to classes and layers
252
  hyp['obj'] *= (imgsz / 640) ** 2 * 3. / nl # scale to image size and layers