PINTO0309 / onnx2tf

Self-Created Tools to convert ONNX files (NCHW) to TensorFlow/TFLite/Keras format (NHWC). The purpose of this tool is to solve the massive Transpose extrapolation problem in onnx-tensorflow (onnx-tf). I don't need a Star, but give me a pull request.
MIT License
662 stars 65 forks source link

unmatched shape of GlobalAveragePool #658

Closed PriceWang closed 2 months ago

PriceWang commented 2 months ago

Issue Type

Others

OS

Linux

onnx2tf version number

1.22.4

onnx version number

1.16.1

onnxruntime version number

1.18.0

onnxsim (onnx_simplifier) version number

0.4.36

tensorflow version number

2.16.1

Download URL for ONNX

https://huggingface.co/PriceWang/maecg_micro/resolve/main/vit_atto_patch32.onnx

Parameter Replacement JSON

N/A

Description

  1. Purpose: Research development

  2. What:

    I tried to convert .onnx to .tflite with convert(input_onnx_file_path="./ckpts/test.onnx", output_folder_path="./ckpts/", batch_size=1, output_signaturedefs=True, not_use_onnxsim=True)

    and got error

    1

    It seems the error occurs in GlobalAveragePool that uses the wrong dim.

    2
  3. How: No idea for this issue now

  4. Why: I want to generate a tfite model from onnx

PINTO0309 commented 2 months ago
onnx2tf -i vit_atto_patch32.onnx -kat input

image

image