Skip to content

Commit 0b48313

Browse files
PeterH0323hhaAndroid
authored andcommitted
[Fxi] Fix ci bug of BatchATSSAssigner (#232)
* Fix ci bug * Fix ci bug * Fix ci bug * Fix ci bug * Fix ci bug
1 parent 8fc8066 commit 0b48313

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

tests/test_models/test_task_modules/test_assigners/test_batch_atss_assigner.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ def test_batch_atss_assigner_with_empty_gt(self):
8282
[20., -4., 36., 12.],
8383
]).unsqueeze(0).repeat(batch_size, 21, 1)
8484

85-
gt_bboxes = torch.empty(batch_size, 2, 4)
86-
gt_labels = torch.empty(batch_size, 2, 1)
85+
gt_bboxes = torch.zeros(batch_size, 0, 4)
86+
gt_labels = torch.zeros(batch_size, 0, 1)
8787

8888
batch_assign_result = batch_atss_assigner.forward(
8989
pred_bboxes, priors, num_level_bboxes, gt_labels, gt_bboxes,
@@ -101,15 +101,15 @@ def test_batch_atss_assigner_with_empty_gt(self):
101101
torch.Size([batch_size, 84, num_classes]))
102102
self.assertEqual(fg_mask_pre_prior.shape, torch.Size([batch_size, 84]))
103103

104-
def test_batch_atss_assigner_with_empty_boxes(self):
104+
def test_batch_atss_assigner_with_empty_boxs(self):
105105
"""Test corner case where a network might predict no boxes."""
106106
num_classes = 2
107107
batch_size = 2
108108
batch_atss_assigner = BatchATSSAssigner(
109109
topk=3,
110110
iou_calculator=dict(type='mmdet.BboxOverlaps2D'),
111111
num_classes=num_classes)
112-
priors = torch.empty(84, 4)
112+
priors = torch.zeros(84, 4)
113113
gt_bboxes = torch.FloatTensor([
114114
[0, 0, 60, 93],
115115
[229, 0, 532, 157],
@@ -152,12 +152,12 @@ def test_batch_atss_assigner_with_empty_boxes_and_gt(self):
152152
topk=3,
153153
iou_calculator=dict(type='mmdet.BboxOverlaps2D'),
154154
num_classes=num_classes)
155-
priors = torch.empty(84, 4)
156-
gt_bboxes = torch.empty(batch_size, 2, 4)
157-
gt_labels = torch.empty(batch_size, 2, 1)
155+
priors = torch.zeros(84, 4)
156+
gt_bboxes = torch.zeros(batch_size, 0, 4)
157+
gt_labels = torch.zeros(batch_size, 0, 1)
158158
num_level_bboxes = [64, 16, 4]
159-
pad_bbox_flag = torch.empty(batch_size, 2, 1)
160-
pred_bboxes = torch.empty(batch_size, 84, 4)
159+
pad_bbox_flag = torch.zeros(batch_size, 0, 1)
160+
pred_bboxes = torch.zeros(batch_size, 0, 4)
161161

162162
batch_assign_result = batch_atss_assigner.forward(
163163
pred_bboxes, priors, num_level_bboxes, gt_labels, gt_bboxes,

0 commit comments

Comments
 (0)