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.2.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.2-py3-none-any.whl (41.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onnx-connx-neowine-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 2f0336e5f55c3e10ecb943d0b0b5c1666606c2d85c09359bd2d171c8c2e6897f
MD5 34be02e0a386a288dc40410908f39271
BLAKE2b-256 2232c02e336ef6b336a91c1e65679106dc90159cf5ac3a378ccb704c82d7c72e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onnx_connx_neowine-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 20200bfadebe9a482202d6806eb6b66933c0825c58515d7c8a1961bc90d782ef
MD5 8f0064b0205a0de3b5a8cd554086bd7a
BLAKE2b-256 b4608b66e989335479b1cb86dacce751cd4cbf7ea74621939b6c893bb3d621b0

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