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.3.tar.gz
(326.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.3-py3-none-any.whl
(282.8 kB
view details)
File details
Details for the file onnxifier-2.0.3.tar.gz.
File metadata
- Download URL: onnxifier-2.0.3.tar.gz
- Upload date:
- Size: 326.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35d82e5667f10f6281a8f41465f8d0289ee0295005aa53662a2e480d5cb83a24
|
|
| MD5 |
e94364dee344ee148760474adb085318
|
|
| BLAKE2b-256 |
646355b1cc45ed592aab70e8002fe8472d8ff07cd391acfbd8da119354a582e4
|
File details
Details for the file onnxifier-2.0.3-py3-none-any.whl.
File metadata
- Download URL: onnxifier-2.0.3-py3-none-any.whl
- Upload date:
- Size: 282.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
420b8e5cdb5492546fca45e5abbf3c80de8fcd0e8c4722d266aa081fa294ce9f
|
|
| MD5 |
dd6d62c72fca57160dfdd418d8a0efa1
|
|
| BLAKE2b-256 |
f12aebc2352ae3291e7a427199bccf6ce5835c0f196690ffb98cbf3b49ccbe04
|