"src/diffusers/utils/dummy_optimum_quanto_objects.py" did not exist on "836f3f35c2453537ec86b3262c8c197c5d4a2767"
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):
all_bbox_weights = torch.cat(bbox_weights_list,
-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(
self.loss_single,
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