[Enhance]: Avoid crash in empty gt training of GFL (#4631)

* avoid crash in empty gt training of GFL

* real fix of the bug
pull/4643/head
Wenwei Zhang 4 years ago committed by GitHub
parent 283f82098b
commit 2a24412846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      mmdet/models/dense_heads/gfl_head.py

@ -284,7 +284,7 @@ class GFLHead(AnchorHead):
else:
loss_bbox = bbox_pred.sum() * 0
loss_dfl = bbox_pred.sum() * 0
weight_targets = torch.tensor(0).cuda()
weight_targets = bbox_pred.new_tensor(0)
# cls (qfl) loss
loss_cls = self.loss_cls(

Loading…
Cancel
Save