Unverified 提交 a4fece8c authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

DDP `nl` fix (#5332)

上级 9c31a66f
...@@ -246,7 +246,7 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary ...@@ -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 = DDP(model, device_ids=[LOCAL_RANK], output_device=LOCAL_RANK)
# Model parameters # 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['box'] *= 3. / nl # scale to layers
hyp['cls'] *= nc / 80. * 3. / nl # scale to classes and 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 hyp['obj'] *= (imgsz / 640) ** 2 * 3. / nl # scale to image size and layers
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论