Skip to content

Commit 7893509

Browse files
authored
Support ppocr_mobile_det model of op11 (#272)
* fixed ppocr_det op11 has huge diff * fixed some bugs * fixed nearest bugs * fixed nearest bugs
1 parent f8db7b7 commit 7893509

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

paddle2onnx/op_mapper/tensor.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,12 +1027,21 @@ def opset_11(cls, graph, node, **kw):
10271027
in_shape, out_shape = cls.compute_output_shape_by_size(graph,
10281028
node)
10291029
inputs += [empty_node, out_shape]
1030-
graph.make_node(
1031-
'Resize',
1032-
inputs=inputs,
1033-
outputs=node.output('Out'),
1034-
mode=resize_type,
1035-
coordinate_transformation_mode=coordinate_transformation_mode)
1030+
if resize_type == 'nearest' and coordinate_transformation_mode == 'asymmetric':
1031+
graph.make_node(
1032+
'Resize',
1033+
inputs=inputs,
1034+
outputs=node.output('Out'),
1035+
mode=resize_type,
1036+
coordinate_transformation_mode=coordinate_transformation_mode,
1037+
nearest_mode='floor')
1038+
else:
1039+
graph.make_node(
1040+
'Resize',
1041+
inputs=inputs,
1042+
outputs=node.output('Out'),
1043+
mode=resize_type,
1044+
coordinate_transformation_mode=coordinate_transformation_mode)
10361045

10371046
@classmethod
10381047
def compute_output_shape(cls, graph, node, opset_version=10):

0 commit comments

Comments
 (0)