Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert uint8 tflite model to onnx has dequant and quant nodes #2338

Open
tensorbuffer opened this issue Jun 7, 2024 · 0 comments
Open

convert uint8 tflite model to onnx has dequant and quant nodes #2338

tensorbuffer opened this issue Jun 7, 2024 · 0 comments
Labels
bug An unexpected problem or unintended behavior

Comments

@tensorbuffer
Copy link

Describe the bug

The generated graph has consecutive dequant and quant node, with same scale and zero point. These are not needed.
The weights can have one dequant to make it from uint8 to float.

Urgency

Kind of urgent. If this path (tflite to onnx) doesn't work, need to look into pb to onnx, but then pb have QAT fake quant nodes, not sure if that has issue converting or not.

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 18.04*): Ubuntu 20.04.6 LTS
  • TensorFlow Version:2.11.0
  • Python version:3.8.17
  • ONNX version (if applicable, e.g. 1.11*):1.15.0
  • ONNXRuntime version (if applicable, e.g. 1.11*):1.16.3

To Reproduce

python -m tf2onnx.convert --opset 16 --tflite ../tree_seg.tflite --output tree_seg.onnx

Screenshots

tflite2onnx
the two nodes between the two conv nodes are not needed.

Additional context

tree_seg.zip

@tensorbuffer tensorbuffer added the bug An unexpected problem or unintended behavior label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant