/onnx-tensorflow

Tensorflow Backend for ONNX

Primary LanguagePythonApache License 2.0Apache-2.0

Tensorflow Backend for ONNX

Build Status

To install:

Firstly install ONNX which cannot be installed by pip unless protoc is available.

Then, run pip install onnx-tf

To test:

run python -m unittest discover test

Example:

In this example, we will define and run a Relu node and print the result. This example is available as a python script at example/relu.py .

from onnx_tf.backend import run_node
from onnx import helper

node_def = helper.make_node("Relu", ["X"], ["Y"])
output = run_node(node_def, [[-0.1, 0.1]])
print(output["Y"])

The result is [ 0. 0.1]

Development Install:

  • Install ONNX
  • Git clone
  • Run pip install -e . on the root directory.
  • Backend dev follows conventions here.

Folder Structure:

  • onnx_tf main source code file.
  • test test files.

Code Standard:

  • Install pylint:
pip install pylint
wget -O /tmp/pylintrc https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/tools/ci_build/pylintrc
  • Check format:
pylint --rcfile=/tmp/pylintrc myfile.py

Documentation Standard:

http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html

Test Help:

https://docs.python.org/2/library/unittest.html

Authors:

Arpith Jacob

Tian Jin

Gheorghe-Teodor Bercea