wwqgtxx commited on
Commit
7209dd0
·
1 Parent(s): 88f2356

fix(model): yolo_head.py not support fp16 when fallback to cpu mode (#688)

Browse files
Files changed (1) hide show
  1. yolox/models/yolo_head.py +1 -1
yolox/models/yolo_head.py CHANGED
@@ -489,7 +489,7 @@ class YOLOXHead(nn.Module):
489
  with torch.cuda.amp.autocast(enabled=False):
490
  cls_preds_ = (
491
  cls_preds_.float().unsqueeze(0).repeat(num_gt, 1, 1).sigmoid_()
492
- * obj_preds_.unsqueeze(0).repeat(num_gt, 1, 1).sigmoid_()
493
  )
494
  pair_wise_cls_loss = F.binary_cross_entropy(
495
  cls_preds_.sqrt_(), gt_cls_per_image, reduction="none"
 
489
  with torch.cuda.amp.autocast(enabled=False):
490
  cls_preds_ = (
491
  cls_preds_.float().unsqueeze(0).repeat(num_gt, 1, 1).sigmoid_()
492
+ * obj_preds_.float().unsqueeze(0).repeat(num_gt, 1, 1).sigmoid_()
493
  )
494
  pair_wise_cls_loss = F.binary_cross_entropy(
495
  cls_preds_.sqrt_(), gt_cls_per_image, reduction="none"