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 in Conv2D is wrong #8

Closed
luuuyi opened this issue Jan 15, 2019 · 2 comments
Closed

flops in Conv2D is wrong #8

luuuyi opened this issue Jan 15, 2019 · 2 comments

Comments

@luuuyi
Copy link

luuuyi commented Jan 15, 2019

First, nice work. But I found something wrong when calculating flops in torch.nn.Conv2d, in count_hooks.py file, the out_w = y.size(2) // m.stride[0] is wrong, it must be out_w = y.size(2). The same as out_h.
So the flops result is less than standard ones.

@luuuyi
Copy link
Author

luuuyi commented Jan 15, 2019

And y.size(2) should be H in NCH*W, in your code, it's W.

@Lyken17
Copy link
Owner

Lyken17 commented Feb 19, 2019

Thanks for the correction. PR merged.

@Lyken17 Lyken17 closed this as completed Feb 19, 2019
Lyken17 added a commit that referenced this issue Feb 19, 2019
Fix #8: flops in Conv2D is wrong
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

2 participants