Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 909 Bytes

README.md

File metadata and controls

39 lines (28 loc) · 909 Bytes

ONNX Operations Counter [WIP]

GitHub License Downloads PyPI

Counts number of parameters / MACs for ONNX models.

Installation

pip install onnx_opcounter

Basic Usage

Using CLI (calculate number of parameters)

onnx_opcounter {path_to_onnx_model}

Using CLI (calculate number of parameters and MACs)

onnx_opcounter --calculate-macs {path_to_onnx_model}

Using API

from onnx_opcounter import calculate_params
import onnx

model = onnx.load_model('./path/to/onnx/model')
params = calculate_params(model)

print('Number of params:', params)

License

The software is covered by Apache License 2.0.