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.2.tar.gz
(323.6 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.2-py3-none-any.whl
(282.2 kB
view details)
File details
Details for the file onnxifier-2.0.2.tar.gz.
File metadata
- Download URL: onnxifier-2.0.2.tar.gz
- Upload date:
- Size: 323.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cde59a2b879ada1b0947aa9a34b08b99d0e1e2860ed01049454f88238c6fb5ff
|
|
| MD5 |
c2fae65e54b4040be7d39878d110c65d
|
|
| BLAKE2b-256 |
d61073a5052d2f34b5fd93790d487ee41fa544eaaf3621963961ad0d03323d00
|
File details
Details for the file onnxifier-2.0.2-py3-none-any.whl.
File metadata
- Download URL: onnxifier-2.0.2-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 |
21bb9f833d30656d3c91644a09d1b65e766c07ac5852f4bef8a975a750f28c5c
|
|
| MD5 |
67bb7e43f7d156430f4c7947c833bdc1
|
|
| BLAKE2b-256 |
6a382eaf6124a1ae79bbb939af03dfd0d1d6680f86ba4dd28c77283b38464f48
|