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.1.1.tar.gz (35.6 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.1.1-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onnx-connx-neowine-0.1.1.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 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.1.1.tar.gz
Algorithm Hash digest
SHA256 1632e8ac54595a29fe7f865ad4439f8ee90994dd79fe2f44c77aeb95f1479d4e
MD5 10f1cce8869c1778028c96636cc86f28
BLAKE2b-256 5727e9307af1a22aea3b287d746ebc3125a4612b7c9737404d897668ac207f6e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onnx_connx_neowine-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 38.8 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.27.1 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8031b16bac014d8087d592554caf673f0c2e9f5be03536dcd1aee997080c456a
MD5 1582e7c4e7a225d7b2ff88171853c665
BLAKE2b-256 cb6d3249994822cb6c06f55e1225d14ff72bb1e200ea4e22e8853b9ebd5e505a

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