"vscode:/vscode.git/clone" did not exist on "37d95157dfed0726d751d3a694e9d6cd3c923097"
Commit 2b8a5f8d authored by Cao Yuhang's avatar Cao Yuhang Committed by Kai Chen
Browse files

add nan checking in ssd head (#1935)

parent 318fc76c
...@@ -182,6 +182,12 @@ class SSDHead(AnchorHead): ...@@ -182,6 +182,12 @@ class SSDHead(AnchorHead):
all_bbox_weights = torch.cat(bbox_weights_list, all_bbox_weights = torch.cat(bbox_weights_list,
-2).view(num_images, -1, 4) -2).view(num_images, -1, 4)
# check NaN and Inf
assert torch.isfinite(all_cls_scores).all().item(), \
'classification scores become infinite or NaN!'
assert torch.isfinite(all_bbox_preds).all().item(), \
'bbox predications become infinite or NaN!'
losses_cls, losses_bbox = multi_apply( losses_cls, losses_bbox = multi_apply(
self.loss_single, self.loss_single,
all_cls_scores, all_cls_scores,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment