Skip to main content

ONNX to CONNX converting tool

Project description

ONNX to CONNX Converter

onnx-connx is a tool which converts ONNX to CONNX model. And onnx-connx is also a NumPy ONNX Runtime implementation for CONNX. We don't recommend to use onnx-connx as an ONNX Runtime for NumPy is very (very) slow.

For users

Install onnx-connx via pip

pip install git+https://github.com/semihlab/onnx-connx

Convert ONNX to CONNX model

python -m onnx_connx --help        # to get help message
python -m onnx_connx [onnx model]  # to convert onnx to connx

For developers

Prepare development environments

  • python3
  • onnx # python package, to run onnx2connx converter
  • protobuf-compiler # to run bin/dump utility
  • tabulate # python package, to run test cases
  • pytest-parallel # python package, to run test cases
$ sudo apt install python3 python3-pip python3-venv
$ python3 -m pip install --user virtualenv
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install --upgrade pip
$ pip install onnx

Debug installation

pip install git+file:///[path-to-onnx-connx]

Dump onnx to text

onnx-connx$ bin/dump [onnx path]  # This utility will dump onnx or pb to text using protoc

Test

Run test

onnx-connx$ make test

Convert all test cases that connx supports

onnx-connx$ make convert-test [ONNX_HOME=[onnx install dir]] [CONNX_HOME=[connx source dir]] # ONNX_HOME and CONNX_HOME can be omitted

Convert individual test case

onnx-connx$ bin/convert [onnx test case path] [connx test case path]

Run connx backend

connx backend will compile the ONNX to CONNX and run it using NumPy operators.

python -m onnx_connx.backend [onnx model] [[input tensor] ...]

Run MNIST example

onnx-connx$ cd examples
onnx-connx/examples$ ./download.sh
onnx-connx/examples$ cd ..
onnx-connx$ python -m onnx_connx.backend examples/mnist/model.onnx examples/mnist/input_0.pb

Contribution

See CONTRIBUTING.md

License

CONNX is licensed under GPLv3. See LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onnx-connx-neowine-0.0.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onnx_connx_neowine-0.0-py3-none-any.whl (39.3 kB view details)

Uploaded Python 3

File details

Details for the file onnx-connx-neowine-0.0.tar.gz.

File metadata

  • Download URL: onnx-connx-neowine-0.0.tar.gz
  • Upload date:
  • Size: 36.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for onnx-connx-neowine-0.0.tar.gz
Algorithm Hash digest
SHA256 1da22b85a94c8f328d20097af17b6204555bb205ba8460cc5ae4cc9a9cd37408
MD5 1dba6a78561bcf1b77e8a52245cbc92e
BLAKE2b-256 33528e65709e959ef1b3a7b85742caa35e15eb83a8a73ca13196367f3f5eaadb

See more details on using hashes here.

File details

Details for the file onnx_connx_neowine-0.0-py3-none-any.whl.

File metadata

  • Download URL: onnx_connx_neowine-0.0-py3-none-any.whl
  • Upload date:
  • Size: 39.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for onnx_connx_neowine-0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f427ff8d3119668abce22d190b41a5679ea8ec1114f3d6c6d2a594681195e7d6
MD5 27bbe60e343b20242b3c1e97325a8d16
BLAKE2b-256 d5d83e36665a3e357d93d310b94e6782f056831b5e21859afa06ab3f751e1b5b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page