A tool for ONNX model:Shape inference, MACs(FLOPs) counting for each layer, Add any layer's output tensors to model's outputs, Export any weights tensors to numpy file. fp16 conversion included,and any operation you can image with ONNX.
Project description
onnx-tool
A tool for ONNX model:
- Shape inference.
- MACs(FLOPs) counting for each layer.
- Add any layer's output tensors to model's outputs.
- Export any weights tensors to numpy file. fp16 conversion included.
...
and any operation you can image with ONNX.
Shape inference
how to use: data/Profile.md.
MACs counting for each layer (FLOPs=2*MACs)
how to use: data/Profile.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
|
|
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file onnx-tool-0.2.2.tar.gz.
File metadata
- Download URL: onnx-tool-0.2.2.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7644860def2ffbe78b705ecdef95c462fef34e244c45b8c28ef0bf187f943502
|
|
| MD5 |
504f72f033fb9cc069b5ac3b9ee7208b
|
|
| BLAKE2b-256 |
53a5eb19f7c8d9a9c4307d19670eea8367e7d96a3119f59aee4ef0a574e1488b
|
File details
Details for the file onnx_tool-0.2.2-py3-none-any.whl.
File metadata
- Download URL: onnx_tool-0.2.2-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7761bfc6e25b05f10cbf2d227beca8bdfb977090849492707e7a33a30f8cabd6
|
|
| MD5 |
d2d767f8520628c2e16c57479d7f81d5
|
|
| BLAKE2b-256 |
f9289a09e2b867a50f9482666ee9b285ab4d5a4f047e862ef02736c2f10e8599
|