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

flops for depthwise convolution layer #41

Closed
pgr2015 opened this issue Aug 23, 2019 · 3 comments
Closed

flops for depthwise convolution layer #41

pgr2015 opened this issue Aug 23, 2019 · 3 comments

Comments

@pgr2015
Copy link

pgr2015 commented Aug 23, 2019

Hi, first of all, thank you for your code. It really helps my work.
I am curious about the flops for depthwise convolutional layer, which should be different from the standard conv.
But it seems there is no implementation for such layer in your code. Could you please add support for it?
Thanks!

@Lyken17
Copy link
Owner

Lyken17 commented Aug 24, 2019

Current counting already considers the case.

https://github.com/Lyken17/pytorch-OpCounter/blob/master/thop/count_hooks.py#L24

@Lyken17 Lyken17 closed this as completed Aug 24, 2019
@pgr2015
Copy link
Author

pgr2015 commented Aug 26, 2019

Thank you for your reply! Sorry that I am not familar with pytorch API.

I have checked your code and pytorch documentation, if I understand correctly, the parameter m.groups distinguish the standard conv and depthwise conv. For standard conv m.groups will be 1, but for depthwise conv m.groups will be the number of output channel.
Hope to get your reply, thanks!

@ujsyehao
Copy link

ujsyehao commented Sep 2, 2019

@pgr2015 yes

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