Skip to content

Commit

Permalink
[Fix] Update unit test of CrossEntropyCost (open-mmlab#7537)
Browse files Browse the repository at this point in the history
  • Loading branch information
chhluo authored and SakiRinn committed Mar 17, 2023
1 parent 39aa413 commit 09d0880
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/test_utils/test_assigner.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,13 +620,11 @@ def test_mask_hungarian_match_assigner():
assert (assign_result.gt_inds > 0).sum() == gt_labels.size(0)
assert (assign_result.labels > -1).sum() == gt_labels.size(0)

# test with mask ce mode
# test with ce mode of CrossEntropyLossCost which is not supported yet
assigner_cfg = dict(
cls_cost=dict(type='ClassificationCost', weight=0.0),
mask_cost=dict(
type='CrossEntropyLossCost', weight=1.0, use_sigmoid=False),
dice_cost=dict(type='DiceCost', weight=0.0, pred_act=True, eps=1.0))
self = MaskHungarianAssigner(**assigner_cfg)
with pytest.raises(NotImplementedError):
assign_result = self.assign(cls_pred, mask_pred, gt_labels, gt_masks,
img_meta)
with pytest.raises(AssertionError):
self = MaskHungarianAssigner(**assigner_cfg)

0 comments on commit 09d0880

Please sign in to comment.