diff --git a/x2paddle/op_mapper/dygraph/onnx2paddle/opset9/opset.py b/x2paddle/op_mapper/dygraph/onnx2paddle/opset9/opset.py index e20f6faf3c130a874be4ec90dcabec0c0968808b..f017ac7f92024ada2ce90bee61c3dfaed238a8da 100644 --- a/x2paddle/op_mapper/dygraph/onnx2paddle/opset9/opset.py +++ b/x2paddle/op_mapper/dygraph/onnx2paddle/opset9/opset.py @@ -1738,7 +1738,6 @@ class OpSet9(): _rename_or_remove_weight(self.weights, val_b.name, op_name+'.bias', remove_bias) else: layer_attrs["bias_attr"] = False - input_shape = val_x.out_shapes[0] if reduce(lambda x,y:x*y, input_shape) in [1, -1] and 1 not in input_shape: input_shape[1] = num_in_channels * num_groups input_shape[0] = 0 diff --git a/x2paddle/op_mapper/static/onnx2paddle/opset9/opset.py b/x2paddle/op_mapper/static/onnx2paddle/opset9/opset.py index 9289b4c0b1ed286b7f1dffd0292a9ca95633738f..e6822b0ad95124032027a10dcd4ff554f20c2ffa 100644 --- a/x2paddle/op_mapper/static/onnx2paddle/opset9/opset.py +++ b/x2paddle/op_mapper/static/onnx2paddle/opset9/opset.py @@ -1627,12 +1627,11 @@ class OpSet9(): "groups": num_groups, } layer_inputs = { - "x": val_x.name, + "x": val_x if isinstance(val_x, str) else val_x.name, "weight": val_w.name } if has_bias: layer_inputs["bias"] = val_b.name - input_shape = val_x.out_shapes[0] if reduce(lambda x,y:x*y, input_shape) in [1, -1] and 1 not in input_shape: input_shape[1] = num_in_channels * num_groups input_shape[0] = 0