Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues regarding the computation of FLOPS with thop #69

Closed
Guanghan opened this issue Oct 26, 2020 · 3 comments
Closed

Issues regarding the computation of FLOPS with thop #69

Guanghan opened this issue Oct 26, 2020 · 3 comments

Comments

@Guanghan
Copy link

In model_statistics.py, the FLOPS is computed with the 3rd party package "thop". In their GitHub repo, it has been explained that the output of profile is actually MACs instead of FLOPS.

It is even puzzling with this line of code: self.gflops, self.kparams = flops_count * 1600 * 1e-9, params_count * 1e-3

Multiplying 1e-9 is to make it GMACS, but why multiplying 1600?

@gnkn0028
Copy link

Thank you for your comment. You are correct that the FLOPS it calculates is actually MACs. The reason why 1600 is multiplied is that in some algorithms, the academic is comparing FLOPS of different models with a high resolution. Since the models are pure CNNs, we divide both height and width by 40 times, and multiply the final MACs by 1600.

We notice that it is not good to do so as a module, and we'll fix it in the next patch.

@zhangjiajin
Copy link
Member

We have released a new version and this issue has been resolved. Please try again.
@Guanghan

@Guanghan
Copy link
Author

Thank you for your comments and detailed explanation.

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

No branches or pull requests

3 participants