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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file onnx-connx-neowine-0.1.4.tar.gz.
File metadata
- Download URL: onnx-connx-neowine-0.1.4.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93ca9955e7c7426875e9836ab7b160604d4893354e69dc95f70d2b8d5b36feed
|
|
| MD5 |
aeb0ff6da0771549b0dc5361bf2dd4ef
|
|
| BLAKE2b-256 |
355b003a15150c16e749b4e21cb9219292debaa20f696fdadb860c4dd2974b8c
|
File details
Details for the file onnx_connx_neowine-0.1.4-py3-none-any.whl.
File metadata
- Download URL: onnx_connx_neowine-0.1.4-py3-none-any.whl
- Upload date:
- Size: 41.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b3968908ca55497df4db1638d56b7771badd5db98f31e52b655a93ecf81025a
|
|
| MD5 |
a7fa71339a90de3c67a8d8461f4f35e1
|
|
| BLAKE2b-256 |
327a3ad57f2f1ef38b2d3af1e35560a4a6e07016a1c5fedfba70fca8b6253508
|