An Operation Counter for Efficient Audio/Speech Processing Networks
python setup.py install
Define PyTorch model and its (dummy) input:
import torch
from torchvision.models import resnet18
model = resnet18()
inputs = torch.randn(1, 3, 224, 224)
Measure the number of MACs using
profile_macs
:
from ocean import profile_macs
macs = profile_macs(model, inputs)
Check out the
egs/
folder.
For warnings like
UserWarning: No handlers found: "aten::<a specific operation>". Skipped.
, please register the missing handler toocean/handlers.py
.
https://join.slack.com/t/ocean-zdz3431/shared_invite/zt-jns0uib8-7nEYX8HNq0eq3LYq2Lj8rw