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
708 stars 73 forks source link

Add arm64 docker image #636

Closed ysohma closed 6 months ago

ysohma commented 6 months ago

1. Content and background

Distributed docker image is not compatible with ARM environments such as Apple Silicon Mac. Although Docker offers emulation for x86/amd64 environments, onnx2tf within this emulation mode results in an error, as shown below:

$ root@39d07181ce27:/# onnx2tf -h
> Illegal instruction

This issue is suspected to be caused by the dependency of PyPI TensorFlow on x86-specific instruction sets.

To address this, I've augmented the release process with GitHub Actions to include building and pushing Docker images for Arm64 architecture. This make it possible to execute onnx2tf with docker on Arm64 hosts.

2. Summary of corrections

New workflow is tested on my repo, built and push successfully. Also I checked some test command can work on it. My test workflow: https://github.com/ysohma/onnx2tf/actions/runs/9138403803

3. Before/After (If there is an operating log that can be used as a reference)

4. Issue number (only if there is a related issue)

PINTO0309 commented 6 months ago

Amazing!

ysohma commented 6 months ago

Release workflow run successfully. However amd64 image is missing in the registory. It seems to be overwritten by second(arm64) push.

I've found the solution for this. https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners

I will submit new PR to fix it in few days.