diff --git a/README.md b/README.md index 4123b849..fc9299dd 100644 --- a/README.md +++ b/README.md @@ -299,7 +299,7 @@ Video speed is adjusted approximately 50 times slower than actual speed. docker run --rm -it \ -v `pwd`:/workdir \ -w /workdir \ - ghcr.io/pinto0309/onnx2tf:1.25.11 + ghcr.io/pinto0309/onnx2tf:1.25.12 or @@ -307,7 +307,7 @@ Video speed is adjusted approximately 50 times slower than actual speed. docker run --rm -it \ -v `pwd`:/workdir \ -w /workdir \ - docker.io/pinto0309/onnx2tf:1.25.11 + docker.io/pinto0309/onnx2tf:1.25.12 or @@ -404,7 +404,7 @@ The given SavedModel SignatureDef contains the following input(s): The given SavedModel SignatureDef contains the following output(s): outputs['output_0'] tensor_info: dtype: DT_FLOAT - shape: (1, 1000) # <-- Model design bug in resnet18-v1-7.onnx + shape: (-1, 1000) name: PartitionedCall:0 Method name is: tensorflow/serving/predict diff --git a/onnx2tf/__init__.py b/onnx2tf/__init__.py index b1fc0d33..5b65b5e5 100644 --- a/onnx2tf/__init__.py +++ b/onnx2tf/__init__.py @@ -1,3 +1,3 @@ from onnx2tf.onnx2tf import convert, main -__version__ = '1.25.11' +__version__ = '1.25.12' diff --git a/onnx2tf/ops/Flatten.py b/onnx2tf/ops/Flatten.py index f4a9ef1e..a9f69e85 100644 --- a/onnx2tf/ops/Flatten.py +++ b/onnx2tf/ops/Flatten.py @@ -57,14 +57,17 @@ def make_node( output_shape = graph_node_output.shape dtype = graph_node_output.dtype - axis = graph_node.attrs.get("axis", 0) - if graph_node_input.shape is not None \ - and axis < input_tensor_rank: - axis = convert_axis( - axis=axis, - tensor_rank=len(graph_node_input.shape), - before_op_output_shape_trans=before_op_output_shape_trans, - ) + axis = graph_node.attrs.get("axis", None) + if axis is not None: + if graph_node_input.shape is not None \ + and axis < input_tensor_rank: + axis = convert_axis( + axis=axis, + tensor_rank=len(graph_node_input.shape), + before_op_output_shape_trans=before_op_output_shape_trans, + ) + else: + axis = input_tensor_rank - 1 # Preserving Graph Structure (Dict) tf_layers_dict[graph_node_output.name] = {