diff --git a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py index 61c2124d4314b79b73da4580ea71e037a1ae8aca..a4b3a1565f746e098ccbc77fc6506d345f9fb07c 100755 --- a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py +++ b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py @@ -741,7 +741,6 @@ class OpSet9(): axes = node.get_attr('axes') if axes is None: axes = self.graph.get_input_node(node, idx=1, copy=True) - axes = _const_weight_or_none(axes) if len(val_x.out_shapes[0]) == 0 and len(axes) == 1 and axes[0] == 0: if node.name: self.paddle_graph.add_layer( @@ -1711,8 +1710,7 @@ class OpSet9(): x_shape = val_x.out_shapes[0] y_shape = val_y.out_shapes[0] inputs_dict = {"x": val_x.name, "y": val_y.name} - if len(y_shape) != 0 and y_shape[0] == 1 and len( - x_shape) != 0 and x_shape[-1] != 1 and x_shape[0] != 1: + if y_shape[0] == 1 and x_shape[-1] != 1 and x_shape[0] != 1: y_squeeze = val_y.name + '_squeeze' self.paddle_graph.add_layer( "paddle.squeeze",