Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gmalivenko/onnx-opcounter
Count number of parameters / MACs / FLOPS for ONNX models.
https://github.com/gmalivenko/onnx-opcounter
cli flops machine-learning macs onnx onnx-models
Last synced: 11 days ago
JSON representation
Count number of parameters / MACs / FLOPS for ONNX models.
- Host: GitHub
- URL: https://github.com/gmalivenko/onnx-opcounter
- Owner: gmalivenko
- License: apache-2.0
- Created: 2020-12-17T21:05:42.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-27T06:59:46.000Z (about 3 years ago)
- Last Synced: 2024-10-23T13:33:29.119Z (21 days ago)
- Topics: cli, flops, machine-learning, macs, onnx, onnx-models
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 85
- Watchers: 2
- Forks: 21
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ONNX Operations Counter [WIP]
[![GitHub License](https://img.shields.io/badge/Apache-2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Downloads](https://pepy.tech/badge/onnx_opcounter)](https://pepy.tech/project/onnx_opcounter)
![PyPI](https://img.shields.io/pypi/v/onnx_opcounter.svg)Counts number of parameters / MACs for ONNX models.
## Installation
```bash
pip install onnx_opcounter
```## Basic Usage
### Using CLI (calculate number of parameters)
```bash
onnx_opcounter {path_to_onnx_model}
```### Using CLI (calculate number of parameters and MACs)
```bash
onnx_opcounter --calculate-macs {path_to_onnx_model}
```### Using API
```python
from onnx_opcounter import calculate_params
import onnxmodel = 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.