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

about MACS and FLOPS #98

Closed
leeqiaogithub opened this issue Nov 23, 2022 · 2 comments
Closed

about MACS and FLOPS #98

leeqiaogithub opened this issue Nov 23, 2022 · 2 comments
Labels
question Further information is requested

Comments

@leeqiaogithub
Copy link

I suspect ptflops confused MACS with FLOPS.

for example:
I got one conv = nn.Conv2d(3, 32, kernel_size=7, stride=2, padding=3)
ptflops output is : 4.91 GMac
(conv): Conv2d(0.005 M, 0.158% Params, 4.91 GMac, 1.879% MACs, 3, 32, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3))
We know by hand that conv operetor has a force of 4.877GFLPS.【2kkCinCoutHoutWout】

So I want to know if the library has the wrong units

@sovrasov
Copy link
Owner

See #16 and https://github.com/sovrasov/flops-counter.pytorch/blob/master/ptflops/pytorch_ops.py#L53 for the reference. I don't know the input / output resolution in your example, so I can't say if it is correct or not.

@sovrasov sovrasov added the question Further information is requested label Nov 23, 2022
@leeqiaogithub
Copy link
Author

@sovrasov I think I made a mistake. My network was called twice, so the difference was exactly two times. But thank you for your reply!

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

No branches or pull requests

2 participants