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.3.tar.gz (38.2 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.3-py3-none-any.whl (41.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onnx-connx-neowine-0.1.3.tar.gz
  • Upload date:
  • Size: 38.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for onnx-connx-neowine-0.1.3.tar.gz
Algorithm Hash digest
SHA256 25280b1e8a3eca20d63ed8cd49c1447ddc38ff6ea1dd8b5f658cee031f6b3901
MD5 f569f48d70b265889a4b7844a78a54d3
BLAKE2b-256 8102bced3a9258431cb53a538171ca926dee2917fad89f93f14ecbc659d69b86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onnx_connx_neowine-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2631f5ed05d10f6421547bd5b0441a4a5a915b667a66024e4534b5bfd7bfe6f3
MD5 562fec1d26782f0f52727de22b58dcb4
BLAKE2b-256 595c4721597d00302431652a4171f5905d75f0c54143336d51fa9ea0f9917c3b

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