A Python to count flops of pytorch models.
Project description
Flopper - A FLOP counter for PyTorch
An enhanced FLOP counter based on fvcore with additional support to custom modules and simplified API This tool is a lightweight wrapper around fvcore flop counter, which is a PyTorch based FLOP counter. It supports counting FLOPs for custom modules and provides a simplified API.
Installation
pip install flopper
Usage
from flopper import count_flops
model = YourRandomModel()
batch = torch.randn(1, 3, 224, 224)
flops = count_flops(model, batch)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flopper-0.1.2.tar.gz
(9.8 kB
view hashes)