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.0.1.tar.gz
(320.3 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.0.1-py3-none-any.whl
(282.2 kB
view details)
File details
Details for the file onnxifier-2.0.1.tar.gz.
File metadata
- Download URL: onnxifier-2.0.1.tar.gz
- Upload date:
- Size: 320.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb9f2858c0b03193531ca43a7247c97f5237cd8da37cd8c4a097814fd18321a8
|
|
| MD5 |
2c23a55c4aa1a89752cca93e4f28ff5c
|
|
| BLAKE2b-256 |
1225ae73706fb40e9ec0a49463993a9c32c1d2ebedb5ce4cba354f679b350f50
|
File details
Details for the file onnxifier-2.0.1-py3-none-any.whl.
File metadata
- Download URL: onnxifier-2.0.1-py3-none-any.whl
- Upload date:
- Size: 282.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd8559a96a8d58b362cf4900e4e3ef258fd69387d458733a1d8dd9fa845c35d9
|
|
| MD5 |
4ac3cae7a1c571b83de2bbe3a9d2df82
|
|
| BLAKE2b-256 |
5872fab6117fc2d621f3da607186d2f7c45ede04f351666c2920755bf94fb3ee
|