Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ppdet/modeling/post_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ def get_pred(self, bboxes, bbox_num, im_shape, scale_factor):
else:
# simplify the computation for bs=1 when exporting onnx
scale_y, scale_x = scale_factor[0][0], scale_factor[0][1]
# TODO(PIR): indexing yields 0-d tensors which concat rejects.
scale_y = paddle.unsqueeze(scale_y, 0)
scale_x = paddle.unsqueeze(scale_x, 0)
scale = paddle.concat(
[scale_x, scale_y, scale_x, scale_y]).unsqueeze(0)
self.origin_shape_list = paddle.expand(origin_shape,
Expand Down
2 changes: 1 addition & 1 deletion ppdet/modeling/proposal_generator/rpn_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def _gen_proposal(self, scores, bbox_deltas, anchors, inputs):

if self.export_onnx:
output_rois = [onnx_topk_rois]
output_rois_num = paddle.shape(onnx_topk_rois)[0]
output_rois_num = paddle.shape(onnx_topk_rois)[0:1]
else:
output_rois = bs_rois_collect
output_rois_num = bs_rois_num_collect
Expand Down