未验证 提交 0c4166af 编写于 作者: S shangliang Xu 提交者: GitHub

fix assigner dtype error (#5665)

上级 f163d8e9
...@@ -124,7 +124,8 @@ class ATSSAssigner(nn.Layer): ...@@ -124,7 +124,8 @@ class ATSSAssigner(nn.Layer):
# negative batch # negative batch
if num_max_boxes == 0: if num_max_boxes == 0:
assigned_labels = paddle.full([batch_size, num_anchors], bg_index) assigned_labels = paddle.full(
[batch_size, num_anchors], bg_index, dtype=gt_labels.dtype)
assigned_bboxes = paddle.zeros([batch_size, num_anchors, 4]) assigned_bboxes = paddle.zeros([batch_size, num_anchors, 4])
assigned_scores = paddle.zeros( assigned_scores = paddle.zeros(
[batch_size, num_anchors, self.num_classes]) [batch_size, num_anchors, self.num_classes])
......
...@@ -85,7 +85,8 @@ class TaskAlignedAssigner(nn.Layer): ...@@ -85,7 +85,8 @@ class TaskAlignedAssigner(nn.Layer):
# negative batch # negative batch
if num_max_boxes == 0: if num_max_boxes == 0:
assigned_labels = paddle.full([batch_size, num_anchors], bg_index) assigned_labels = paddle.full(
[batch_size, num_anchors], bg_index, dtype=gt_labels.dtype)
assigned_bboxes = paddle.zeros([batch_size, num_anchors, 4]) assigned_bboxes = paddle.zeros([batch_size, num_anchors, 4])
assigned_scores = paddle.zeros( assigned_scores = paddle.zeros(
[batch_size, num_anchors, num_classes]) [batch_size, num_anchors, num_classes])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册