Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Calculate FLOPs and Params #36

Open
yiyi-today opened this issue Aug 15, 2022 · 2 comments
Open

Calculate FLOPs and Params #36

yiyi-today opened this issue Aug 15, 2022 · 2 comments

Comments

@yiyi-today
Copy link

You recommend using thop (https://github.com/Lyken17/pytorch-OpCounter) to calculate FLOPs, but the official example of pytorch-OpCounter calculates MACs, does MACs(G)=FLOPs?In addition, why is the Params I calculated slightly different from yours? FC-EF: Params(M)-1.1, MACs=2.02; FC-Siam-conc: Params(M)-1.55, MACs=5.33; FC-Siam-diff: Params(M)-1.35, MACs=4.73;
SNUNet(32):Params(M)-12.03, MACs=54.83.
Hope to get your answer, thank you!

@likyoo
Copy link
Owner

likyoo commented Aug 15, 2022

here

@yiyi-today
Copy link
Author

Thanks a lot for your answer. I still have the following doubts:

  1. Following the link you gave, FLOPs = 2 * MACs, right?
  2. In addition, I read some papers, why there is some gap between the FLOPs and Params of the same method of calculation, and the gap between Params is even large. Why is this? Is it related to the configuration of different computers?
  3. Are FLOPs and Params used to evaluate model complexity? If I want to consider time cost, what indicator should I use?
    Sorry for asking you a lot of questions at one time, I hope to get your answer within your acceptable range, thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants