onnx-tool
A tool for ONNX model:
- Shape inference.
- MACs(FLOPs) counting for each layer.
- Extract subgraph from ONNX model, or do inplace op fusion.
...
and any operation you can image with ONNX.
New: Pytorch models are also valid if torch.onnx.export succeeded.
Shape inference
how to use: data/Profile.md.
pytorch usage: data/PytorchUsage.md.
MACs counting for each layer (FLOPs=2*MACs)
how to use: data/Profile.md.
pytorch usage: data/PytorchUsage.md.
Extract subgraph from ONNX model
how to use: data/Subgraph.md.
Inplace op fusion
how to use: data/Subgraph.md.
Add any hidden tensors to model's outputs
how to use: data/Profile.md.
Tensor operations
- Export weight tensors to files
- Simplify tensor and node names, convert name from a long string to a short string
- Remove unused tensors, models like vgg19-7.onnx set its static weight tensors as its input tensors
- Set custom input and output tensors' name and dimension, change model from fixed input to dynamic input
how to use: data/Tensors.md.
How to install
pip install onnx-tool
OR
pip install --upgrade git+https://github.com/ThanatosShinji/onnx-tool.git
python>=3.6
If pip install onnx-tool failed by onnx's installation, you may try pip install onnx==1.8.1 (a lower version like this) first.
Then pip install onnx-tool again.
Known Issues
- Loop op is not supported
Results of ONNX Model Zoo and SOTA models
Some models have dynamic input shapes. The MACs varies from input shapes. The input shapes used in these results are writen to data/public/config.py. These onnx models with all tensors' shape can be downloaded: baidu drive(code: p91k) google drive
|
|
Metadata
Release files for onnx-tool 0.2.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| onnx-tool-0.2.9.tar.gz | 23.1 kB | Without provenance | Details for onnx-tool-0.2.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| onnx_tool-0.2.9-py3-none-any.whl | Python 3 | none | any | Details for onnx_tool-0.2.9-py3-none-any.whl |
Total release size: 45.6 kB
Release files / onnx-tool-0.2.9.tar.gz
| Download URL | onnx-tool-0.2.9.tar.gz |
|---|---|
| Size | 23.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6e1f2e82c4a4ee5223e5165ecc808401aaa2263b8495ada93d215775c187e8b6
|
|
BLAKE2b-256 checksum How to use checksums |
860b07e89e3f4cd95e38bf180c656d7a0b6e43a439b4ac86899353e059a4ef4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Release files / onnx_tool-0.2.9-py3-none-any.whl
| Download URL | onnx_tool-0.2.9-py3-none-any.whl |
|---|---|
| Size | 22.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a429213e5c2573914cbec2786e4020e9f5b1afd69a155c9b0f88bd09191a784a
|
|
BLAKE2b-256 checksum How to use checksums |
366918c9e9574bb95226f877bb19092c94d87f120d7d7eace76e39c7fffa5847
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Security for onnx-tool 0.2.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.