Skip to content

An Operation Counter for Efficient Audio/Speech Processing Networks

License

Notifications You must be signed in to change notification settings

Peidong-Wang/OCEAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Install and Use

  1. Installation:

python setup.py install

  1. A simple example:

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)
  1. Examples:

Check out the egs/ folder.

  1. Handler registration:

For warnings like UserWarning: No handlers found: "aten::<a specific operation>". Skipped., please register the missing handler to ocean/handlers.py.

 

Updates and Acknowledgement

  1. The default version of OCEAN now uses torch.jit.trace as in torchprofile: https://github.com/zhijian-liu/torchprofile.
  2. The THOP (https://github.com/Lyken17/pytorch-OpCounter.git) based version is saved to the thop branch.

 

Slack Group

https://join.slack.com/t/ocean-zdz3431/shared_invite/zt-jns0uib8-7nEYX8HNq0eq3LYq2Lj8rw

About

An Operation Counter for Efficient Audio/Speech Processing Networks

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages