"...en/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "ea1b4ea7ca5fa7ab3d2094a70a35481f2a1036c2"
Unverified Commit ab8644ea authored by Yezhen Cong's avatar Yezhen Cong Committed by GitHub
Browse files

[Fix]: Fix error in four unittest functions (#453)

parent 4002f06c
...@@ -148,78 +148,77 @@ model = dict( ...@@ -148,78 +148,77 @@ model = dict(
loss_weight=1.0), loss_weight=1.0),
loss_bbox=dict(type='SmoothL1Loss', beta=1.0 / 9.0, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0 / 9.0, loss_weight=1.0),
loss_dir=dict( loss_dir=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.2))) type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.2)),
# model training and testing settings
# model training and testing settings train_cfg=dict(
train_cfg = dict( _delete_=True,
_delete_=True, pts=dict(
pts=dict( assigner=[
assigner=[ dict( # bicycle
dict( # bicycle type='MaxIoUAssigner',
type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'),
iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.55,
pos_iou_thr=0.55, neg_iou_thr=0.4,
neg_iou_thr=0.4, min_pos_iou=0.4,
min_pos_iou=0.4, ignore_iof_thr=-1),
ignore_iof_thr=-1), dict( # motorcycle
dict( # motorcycle type='MaxIoUAssigner',
type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'),
iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.55,
pos_iou_thr=0.55, neg_iou_thr=0.4,
neg_iou_thr=0.4, min_pos_iou=0.4,
min_pos_iou=0.4, ignore_iof_thr=-1),
ignore_iof_thr=-1), dict( # pedestrian
dict( # pedestrian type='MaxIoUAssigner',
type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'),
iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.55,
pos_iou_thr=0.55, neg_iou_thr=0.4,
neg_iou_thr=0.4, min_pos_iou=0.4,
min_pos_iou=0.4, ignore_iof_thr=-1),
ignore_iof_thr=-1), dict( # animal
dict( # animal type='MaxIoUAssigner',
type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'),
iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.55,
pos_iou_thr=0.55, neg_iou_thr=0.4,
neg_iou_thr=0.4, min_pos_iou=0.4,
min_pos_iou=0.4, ignore_iof_thr=-1),
ignore_iof_thr=-1), dict( # car
dict( # car type='MaxIoUAssigner',
type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'),
iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.6,
pos_iou_thr=0.6, neg_iou_thr=0.45,
neg_iou_thr=0.45, min_pos_iou=0.45,
min_pos_iou=0.45, ignore_iof_thr=-1),
ignore_iof_thr=-1), dict( # emergency vehicle
dict( # emergency vehicle type='MaxIoUAssigner',
type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'),
iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.55,
pos_iou_thr=0.55, neg_iou_thr=0.4,
neg_iou_thr=0.4, min_pos_iou=0.4,
min_pos_iou=0.4, ignore_iof_thr=-1),
ignore_iof_thr=-1), dict( # bus
dict( # bus type='MaxIoUAssigner',
type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'),
iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.6,
pos_iou_thr=0.6, neg_iou_thr=0.45,
neg_iou_thr=0.45, min_pos_iou=0.45,
min_pos_iou=0.45, ignore_iof_thr=-1),
ignore_iof_thr=-1), dict( # other vehicle
dict( # other vehicle type='MaxIoUAssigner',
type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'),
iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.55,
pos_iou_thr=0.55, neg_iou_thr=0.4,
neg_iou_thr=0.4, min_pos_iou=0.4,
min_pos_iou=0.4, ignore_iof_thr=-1),
ignore_iof_thr=-1), dict( # truck
dict( # truck type='MaxIoUAssigner',
type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'),
iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.6,
pos_iou_thr=0.6, neg_iou_thr=0.45,
neg_iou_thr=0.45, min_pos_iou=0.45,
min_pos_iou=0.45, ignore_iof_thr=-1)
ignore_iof_thr=-1) ],
], allowed_border=0,
allowed_border=0, code_weight=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
code_weight=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], pos_weight=-1,
pos_weight=-1, debug=False)))
debug=False))
...@@ -136,19 +136,18 @@ def test_3dssd(): ...@@ -136,19 +136,18 @@ def test_3dssd():
gt_bbox_0 = DepthInstance3DBoxes(torch.rand([10, 7], device='cuda')) gt_bbox_0 = DepthInstance3DBoxes(torch.rand([10, 7], device='cuda'))
gt_bbox_1 = DepthInstance3DBoxes(torch.rand([10, 7], device='cuda')) gt_bbox_1 = DepthInstance3DBoxes(torch.rand([10, 7], device='cuda'))
gt_bboxes = [gt_bbox_0, gt_bbox_1] gt_bboxes = [gt_bbox_0, gt_bbox_1]
gt_labels_0 = torch.randint(0, 10, [10], device='cuda') gt_labels_0 = torch.zeros([10], device='cuda').long()
gt_labels_1 = torch.randint(0, 10, [10], device='cuda') gt_labels_1 = torch.zeros([10], device='cuda').long()
gt_labels = [gt_labels_0, gt_labels_1] gt_labels = [gt_labels_0, gt_labels_1]
# test forward_train # test forward_train
losses = self.forward_train(points, img_metas, gt_bboxes, gt_labels) losses = self.forward_train(points, img_metas, gt_bboxes, gt_labels)
assert losses['vote_loss'] >= 0 assert losses['vote_loss'] >= 0
assert losses['objectness_loss'] >= 0 assert losses['centerness_loss'] >= 0
assert losses['semantic_loss'] >= 0
assert losses['center_loss'] >= 0 assert losses['center_loss'] >= 0
assert losses['dir_class_loss'] >= 0 assert losses['dir_class_loss'] >= 0
assert losses['dir_res_loss'] >= 0 assert losses['dir_res_loss'] >= 0
assert losses['size_class_loss'] >= 0 assert losses['corner_loss'] >= 0
assert losses['size_res_loss'] >= 0 assert losses['size_res_loss'] >= 0
# test simple_test # test simple_test
......
...@@ -593,7 +593,7 @@ def test_h3d_head(): ...@@ -593,7 +593,7 @@ def test_h3d_head():
pytest.skip('test requires GPU and torch+cuda') pytest.skip('test requires GPU and torch+cuda')
_setup_seed(0) _setup_seed(0)
h3d_head_cfg = _get_roi_head_cfg('h3dnet/h3dnet_8x3_scannet-3d-18class.py') h3d_head_cfg = _get_roi_head_cfg('h3dnet/h3dnet_3x8_scannet-3d-18class.py')
num_point = 128 num_point = 128
num_proposal = 64 num_proposal = 64
...@@ -907,7 +907,7 @@ def test_ssd3d_head(): ...@@ -907,7 +907,7 @@ def test_ssd3d_head():
assert ret_dict['dir_res'].shape == torch.Size([2, 64, 12]) assert ret_dict['dir_res'].shape == torch.Size([2, 64, 12])
# test loss # test loss
points = [torch.rand([4000, 4], device='cuda') for i in range(2)] points = [torch.rand([4000, 3], device='cuda') for i in range(2)]
gt_bbox1 = LiDARInstance3DBoxes(torch.rand([5, 7], device='cuda')) gt_bbox1 = LiDARInstance3DBoxes(torch.rand([5, 7], device='cuda'))
gt_bbox2 = LiDARInstance3DBoxes(torch.rand([5, 7], device='cuda')) gt_bbox2 = LiDARInstance3DBoxes(torch.rand([5, 7], device='cuda'))
gt_bboxes = [gt_bbox1, gt_bbox2] gt_bboxes = [gt_bbox1, gt_bbox2]
......
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