An Open Neural Network Exchange (ONNX) Optimization and Transformation Tool.
Project description
ONNXifier
A simple tool to convert any IR format to ONNX file.
| Framework | Status |
|---|---|
| OpenVINO | ✅ |
| ONNXRuntime | ✅ |
- ✅: well supported
- 🪛: partially supported
- 🚧: developing
Usage
- Install from PyPI
pip install onnxifier
- Convert IR using CLI
onnxify model.xml
usage: onnxify input_model.xml [output_model.onnx]
onnxify command-line api
options:
-h, --help show this help message and exit
-a [ACTIVATE ...], --activate [ACTIVATE ...]
select passes to be activated, activate L1, L2 and L3 passes if not set.
-r [REMOVE ...], --remove [REMOVE ...]
specify passes to be removed from activated passes.
-n, --no-passes do not run any optimizing passes, just convert the model
--print [PRINT] print the name of all optimizing passes
--format {protobuf,textproto,json,onnxtxt}
onnx file format
-s, --infer-shapes infer model shapes
-c CONFIG_FILE, --config-file CONFIG_FILE
specify a json-format config file for passes
-u, --uncheck no checking output model
--check check optimized model with random inputs
--checker-backend {onnx,openvino,onnxruntime}
backend for accuracy checking, defaults to openvino
-v OPSET_VERSION, --opset-version OPSET_VERSION
target opset version, defaults to 19
-vv [{DEBUG,INFO,WARNING,ERROR,CRITICAL}], --log-level [{DEBUG,INFO,WARNING,ERROR,CRITICAL}]
specify the level of log messages to be printed, defaults to INFO
-R, --recursive recursively optimize nested functions
--nodes [NODES ...] specify a set of node names to apply passes only on these nodes
To print pass information:
onnxify --print all
onnxify --print fuse_swish
onnxify --print l1
TODO
Contribute
- pyright type checking
pip install -U pyright
pyright onnxifier
- mypy type checking
pip install -U mypy
mypy onnxifier --disable-error-code=import-untyped --disable-error=override --disable-error=call-overload
- pre-commit checking
pip install -U pre-commit
pre-commit run --all-files
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
onnxifier-2.1.0.tar.gz
(360.0 kB
view details)
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
onnxifier-2.1.0-py3-none-any.whl
(309.7 kB
view details)
File details
Details for the file onnxifier-2.1.0.tar.gz.
File metadata
- Download URL: onnxifier-2.1.0.tar.gz
- Upload date:
- Size: 360.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a37a6e80912c93b0c7eab80b645c65689414bdb7841f575f732edd90a4285894
|
|
| MD5 |
13bb369b3495c79cd6706363b3e7aae7
|
|
| BLAKE2b-256 |
7df8078a4a0487d2dda9dcbc2de205422f55109f3e8181432cf553d8c07880ff
|
File details
Details for the file onnxifier-2.1.0-py3-none-any.whl.
File metadata
- Download URL: onnxifier-2.1.0-py3-none-any.whl
- Upload date:
- Size: 309.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0088b2b8267b9217aba9f5580a3c3af87400f8eac2acc5c0c3ebb8f24ada2e71
|
|
| MD5 |
9e36350ec945052b618bf7f1ac8006c3
|
|
| BLAKE2b-256 |
754d03c86a5ac81a97a4b3a0b8ea0038e55bf5194e9f6d586d40e4402982aa7d
|