Skip to content

Commit

Permalink
DDP nl fix (ultralytics#5332)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored Oct 25, 2021
1 parent 424934d commit 78fc024
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 78fc024

Please sign in to comment.