Skip to content

Commit

Permalink
fix ddp unused param bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gengyifei committed Nov 9, 2022
1 parent 1563345 commit 5738ccf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yolov6/models/loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ def forward(self, pred_dist, pred_bboxes, anchor_points,
else:
loss_dfl = loss_dfl.sum() / target_scores_sum
else:
loss_dfl = torch.tensor(0.).to(pred_dist.device)
loss_dfl = pred_dist.sum() * 0.

else:
loss_iou = torch.tensor(0.).to(pred_dist.device)
loss_dfl = torch.tensor(0.).to(pred_dist.device)
loss_iou = pred_dist.sum() * 0.
loss_dfl = pred_dist.sum() * 0.

return loss_iou, loss_dfl

Expand Down

0 comments on commit 5738ccf

Please sign in to comment.