{"id":15029316,"url":"https://github.com/onnx/onnx-tensorflow","last_synced_at":"2025-05-14T14:04:21.115Z","repository":{"id":39351258,"uuid":"105942505","full_name":"onnx/onnx-tensorflow","owner":"onnx","description":"Tensorflow Backend for ONNX","archived":false,"fork":false,"pushed_at":"2024-03-28T08:15:06.000Z","size":1987,"stargazers_count":1301,"open_issues_count":268,"forks_count":296,"subscribers_count":48,"default_branch":"main","last_synced_at":"2025-05-13T23:14:56.839Z","etag":null,"topics":["deep-learning","deep-neural-networks","onnx","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onnx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-05T21:30:34.000Z","updated_at":"2025-04-27T06:37:10.000Z","dependencies_parsed_at":"2024-06-18T13:39:18.654Z","dependency_job_id":"6c36f075-a218-4feb-b4b8-4488731a6524","html_url":"https://github.com/onnx/onnx-tensorflow","commit_stats":{"total_commits":611,"total_committers":45,"mean_commits":"13.577777777777778","dds":0.8166939443535188,"last_synced_commit":"ee0c5e537b3cebbddc5773871e6786e6468c7f3f"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onnx%2Fonnx-tensorflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onnx%2Fonnx-tensorflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onnx%2Fonnx-tensorflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onnx%2Fonnx-tensorflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onnx","download_url":"https://codeload.github.com/onnx/onnx-tensorflow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254059499,"owners_count":22007768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","deep-neural-networks","onnx","tensorflow"],"created_at":"2024-09-24T20:10:17.820Z","updated_at":"2025-05-14T14:04:21.003Z","avatar_url":"https://github.com/onnx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TensorFlow Backend for ONNX\n![Backend Test Status](https://github.com/onnx/onnx-tensorflow/workflows/Backend%20test/badge.svg)\n![ModelZoo Test Status](https://github.com/onnx/onnx-tensorflow/workflows/ModelZoo%20test/badge.svg)\n\n### Note this repo is not actively maintained and will be deprecated. If you are interested in becoming the owner, please contact the ONNX Steering Committee (https://github.com/onnx/steering-committee).\n\n[Open Neural Network Exchange (ONNX)](https://onnx.ai) is an open standard format for representing machine learning models. ONNX is supported by a community of partners who have implemented it in many frameworks and tools.\n\nTensorFlow Backend for ONNX makes it possible to use ONNX models as input for [TensorFlow](https://www.tensorflow.org). The ONNX model is first converted to a TensorFlow model and then delegated for execution on TensorFlow to produce the output.\n\nThis is one of the two TensorFlow converter projects which serve different purposes in the ONNX community:\n- [onnx-tensorflow](https://github.com/onnx/onnx-tensorflow) converts ONNX models to Tensorflow\n- [tf2onnx](https://github.com/onnx/tensorflow-onnx) converts Tensorflow models to ONNX\n\n## Converting Models from ONNX to TensorFlow\n\n### Use CLI\n\n[Command Line Interface Documentation](https://github.com/onnx/onnx-tensorflow/blob/master/doc/CLI.md)\n\nFrom ONNX to TensorFlow: `onnx-tf convert -i /path/to/input.onnx -o /path/to/output`\n\n### Convert Programmatically\n\n[From ONNX to TensorFlow](https://github.com/onnx/onnx-tensorflow/blob/master/example/onnx_to_tf.py)\n\n### Migrating from `onnx-tf` to `tf-onnx`\nWe have joined force with Microsoft to co-develop ONNX TensorFlow frontend.\nFor current onnx-tf frontend users, please migrate to use tf-onnx (https://github.com/onnx/tensorflow-onnx) where our code had been merged into.\n\n## ONNX Model Inference with TensorFlow Backend\n```\nimport onnx\nfrom onnx_tf.backend import prepare\n\nonnx_model = onnx.load(\"input_path\")  # load onnx model\noutput = prepare(onnx_model).run(input)  # run the loaded model\n```\n\n## More Tutorials\n[Running an ONNX model using TensorFlow](https://github.com/onnx/tutorials/blob/master/tutorials/OnnxTensorflowImport.ipynb)\n\n## Production Installation\nONNX-TF requires ONNX (Open Neural Network Exchange) as an external dependency, for any issues related to ONNX installation, we refer our users to [ONNX project repository](https://github.com/onnx/onnx) for documentation and help. Notably, please ensure that `protoc` is available if you plan to install ONNX via pip.\n\nThe specific ONNX release version that we support in the master branch of ONNX-TF can be found [here](https://github.com/onnx/onnx-tensorflow/blob/master/ONNX_VERSION_NUMBER). This information about ONNX version requirement is automatically encoded in `setup.py`, therefore users needn't worry about ONNX version requirement when installing ONNX-TF.\n\nTo install the latest version of ONNX-TF via pip, run `pip install onnx-tf`.\n\nBecause users often have their own preferences for which variant of TensorFlow to install (i.e., a GPU version instead of a CPU version), we do not explicitly require tensorflow in the installation script. It is therefore users' responsibility to ensure that the proper variant of TensorFlow is available to ONNX-TF. Moreover, we require TensorFlow version == 2.8.0.\n\n## Development\n\n### Coverage Status\n[ONNX-TensorFlow Op Coverage Status](https://github.com/onnx/onnx-tensorflow/blob/master/doc/support_status.md)\n\n### API\n[ONNX-TensorFlow API](https://github.com/onnx/onnx-tensorflow/blob/master/doc/API.md)\n\n### Installation\n- Install ONNX master branch from source.\n- Install TensorFlow \u003e= 2.8.0, tensorflow-probability and tensorflow-addons. (Note TensorFlow 1.x is no longer supported)\n- Run `git clone https://github.com/onnx/onnx-tensorflow.git \u0026\u0026 cd onnx-tensorflow`.\n- Run `pip install -e .`.\n\n### Folder Structure\n- __onnx_tf__: main source code file.\n- __test__: test files.\n\n### Code Standard\n- Format code\n```\npip install yapf\nyapf -rip --style=\"{based_on_style: google, indent_width: 2}\" $FilePath$\n```\n- Install pylint\n```\npip install pylint\nwget -O /tmp/pylintrc https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/tools/ci_build/pylintrc\n```\n- Check format\n```\npylint --rcfile=/tmp/pylintrc myfile.py\n```\n\n### Documentation Standard\n[Google Style Python Docstrings](http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)\n\n## Testing\n\n### Unit Tests\n\nTo perfom [unit tests](https://docs.python.org/3/library/unittest.html):\n\n```\npip install pytest tabulate\npython -m unittest discover test\n```\n\nNote: Only the ONNX backend tests found in [`test_onnx_backend.py`](https://github.com/onnx/onnx-tensorflow/blob/master/test/backend/test_onnx_backend.py) require the `pytest` and `tabulate` packages.\n\nTesting requires significant hardware resources, but nonetheless, we highly recommend that users run through the complete test suite before deploying onnx-tf. The complete test suite typically takes between 15 and 45 minutes to complete, depending on hardware configurations.\n\n### Model Zoo Tests\n\nThe tests in [`test_modelzoo.py`](https://github.com/onnx/onnx-tensorflow/blob/master/test/test_modelzoo.py) verify whether the [ONNX Model Zoo](https://github.com/onnx/models) models can be successfully validated against the ONNX specification and converted to a TensorFlow representation. Model inferencing on the converted model is not tested currently.\n\n#### Prerequisites\n\nThe model zoo uses [Git LFS (Large File Storage)](https://git-lfs.github.com/) to store ONNX model files. Make sure that Git LFS is installed on your operating system.\n\n#### Running\n\nBy default, the tests assume that the model zoo repository has been cloned into this project directory. The model zoo directory is scanned for ONNX models. For each model found: download the model, convert the model to TensorFlow, generate a test status, and delete the model. By default, the generated test report is created in the system temporary directory. Run `python test/test_modelzoo.py -h` for help on command line options.\n\n```\ngit clone https://github.com/onnx/models\npython test/test_modelzoo.py\n```\n\nTesting all models can take at least an hour to complete, depending on hardware configuration and model download times. If you expect to test some models frequently, we recommend using Git LFS to download those models before running the tests so the large files are cached locally.\n\n#### Reports\n\nWhen making code contributions, the model zoo tests are run when a commit is merged. Generated test reports are published on the [onnx-tensorflow wiki](https://github.com/onnx/onnx-tensorflow/wiki/ModelZoo-Status-(branch=master)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonnx%2Fonnx-tensorflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonnx%2Fonnx-tensorflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonnx%2Fonnx-tensorflow/lists"}