Coder Social home page Coder Social logo

lartpang / methodscmp Goto Github PK

View Code? Open in Web Editor NEW
15.0 4.0 4.0 107 KB

MethodsCmp: A Simple Toolkit for Counting the FLOPs/MACs, Parameters and FPS of Pytorch-based Methods

Python 100.00%
pytorch python flops flops-counter memory memory-counter fps fps-counter macs-counter macs

methodscmp's Introduction

A simple toolkit for counting the FLOPs/MACs, Parameters and FPS of the model.

$ python main.py --help
usage: main.py [-h] [--method-names METHOD_NAMES [METHOD_NAMES ...]]
               [--mode {ops_params,fps,gpu_mem} [{ops_params,fps,gpu_mem} ...]]

A simple toolkit for counting the FLOPs/MACs, Parameters, FPS and GPU Memory of the model.

optional arguments:
  -h, --help            show this help message and exit
  --method-names METHOD_NAMES [METHOD_NAMES ...]
                        The names of the methods you want to evaluate.
  --mode {ops_params,fps,gpu_mem} [{ops_params,fps,gpu_mem} ...]

NOTE:

Usage

pip install fvcore

In methods folder, I have provided some recent methods, i.e. CoNet, DANet, HDFNet, JL-DCF, and UC-Net, as the examples.

More functional improvements and suggestions are welcome.

An example:

python main.py --method-names zoomnet ugtr c2fnet ujsc pfnet mgl_r slsr sinet

Change Log

  • 2023-07-28:
    • [New & Important] Update the library for count FLOPs/MACS from pytorch-OpCounter to fvcore which can count FLOPs/MACs of the complex module, like Transformer.
    • Remove the useless test folder.
    • [Experimental Feature] Add the new feature for counting the peak inference GPU memory of the model.
  • 2022-03-03: Add more methods, add the gpu warmup process in counting FPS and update the readme.
  • 2021-09-29: Refactor again.
  • 2021-08-31: Refactor.
  • 2021-08-29: Create a new repository and upload the code.
@misc{MethodsCmp,
	author       = {Youwei Pang},
	title        = {MethodsCmp: A Simple Toolkit for Counting the FLOPs/MACs, Parameters and FPS of Pytorch-based Methods},
	howpublished = {\url{https://github.com/lartpang/MethodsCmp}},
	year         = {2021}
}

methodscmp's People

Contributors

lartpang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

methodscmp's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.