diff --git a/x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/multiclass_nms.py b/x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/multiclass_nms.py index 7060cfbeebcaf69bbb9543774661e8b914aae287..f953ad99d38958f1f8e6fc9927086401a4f28014 100644 --- a/x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/multiclass_nms.py +++ b/x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/multiclass_nms.py @@ -72,7 +72,7 @@ def multiclass_nms(op, block): dims=(), vals=[float(attrs['nms_threshold'])])) - boxes_num = block.var( outputs['Out'][0]).shape[0] + boxes_num = block.var(outputs['Out'][0]).shape[0] top_k_value = np.int64(boxes_num if attrs['keep_top_k'] == -1 else attrs['keep_top_k']) node_keep_top_k = onnx.helper.make_node( 'Constant', diff --git a/x2paddle/op_mapper/paddle2onnx/opset9/paddle_custom_layer/multiclass_nms.py b/x2paddle/op_mapper/paddle2onnx/opset9/paddle_custom_layer/multiclass_nms.py index 57d8a7467789e3bead12c2d3ffaf86a95c397cf8..6d8172fc63c7441ff96b49da44ea700d5700289e 100644 --- a/x2paddle/op_mapper/paddle2onnx/opset9/paddle_custom_layer/multiclass_nms.py +++ b/x2paddle/op_mapper/paddle2onnx/opset9/paddle_custom_layer/multiclass_nms.py @@ -72,7 +72,7 @@ def multiclass_nms(op, block): dims=(), vals=[float(attrs['nms_threshold'])])) - boxes_num = block.var( outputs['Out'][0]).shape[0] + boxes_num = block.var(outputs['Out'][0]).shape[0] top_k_value = np.int64(boxes_num if attrs['keep_top_k'] == -1 else attrs['keep_top_k']) node_keep_top_k = onnx.helper.make_node( 'Constant',