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:
- Memory usage of each layer is valid in v0.2.10 release.
- Pytorch models are also valid if torch.onnx.export succeeded.
how to use: data/Profile.md.
pytorch usage: data/PytorchUsage.md.
Float MultipleAdd Count, Memory Usage(in bytes), Parameters(elements number)
how to use: data/Profile.md.
pytorch usage: data/PytorchUsage.md.
how to use: data/Subgraph.md.
how to use: data/Subgraph.md.
Add any hidden tensors to model's outputs
how to use: data/Profile.md.
- 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.
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.
- 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
|
|