diff --git a/paddle2onnx/op_mapper/tensor.py b/paddle2onnx/op_mapper/tensor.py index 0a301257a..d69c46102 100644 --- a/paddle2onnx/op_mapper/tensor.py +++ b/paddle2onnx/op_mapper/tensor.py @@ -1027,12 +1027,21 @@ def opset_11(cls, graph, node, **kw): in_shape, out_shape = cls.compute_output_shape_by_size(graph, node) inputs += [empty_node, out_shape] - graph.make_node( - 'Resize', - inputs=inputs, - outputs=node.output('Out'), - mode=resize_type, - coordinate_transformation_mode=coordinate_transformation_mode) + if resize_type == 'nearest' and coordinate_transformation_mode == 'asymmetric': + graph.make_node( + 'Resize', + inputs=inputs, + outputs=node.output('Out'), + mode=resize_type, + coordinate_transformation_mode=coordinate_transformation_mode, + nearest_mode='floor') + else: + graph.make_node( + 'Resize', + inputs=inputs, + outputs=node.output('Out'), + mode=resize_type, + coordinate_transformation_mode=coordinate_transformation_mode) @classmethod def compute_output_shape(cls, graph, node, opset_version=10):