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

Count hook for convtranspose2d is wrong #20

Closed
bl0 opened this issue May 5, 2019 · 2 comments
Closed

Count hook for convtranspose2d is wrong #20

bl0 opened this issue May 5, 2019 · 2 comments

Comments

@bl0
Copy link

bl0 commented May 5, 2019

Hi, thanks for your great work. I found an error in the following codes:

ops_per_element = kernel_ops + bias_ops
# total ops
# num_out_elements = y.numel()
# output_elements = batch_size * out_w * out_h * cout
ops_per_element = m.weight.nelement()

It calculates ops_per_element with two different methods. The first is kh * kw * cin, while the second is kh * kw * cin * cout. Obviously, the first one is right, but it's overwrited by the second one.

@feiyangha
Copy link

Hi, I agree with you. The flops of convtranspose2d using this method is too huge.

@Lyken17
Copy link
Owner

Lyken17 commented Jun 18, 2019

Thanks for pointing out. I've fixed. Let me know if you find other errors in count hook.

@bl0 bl0 closed this as completed Jun 19, 2019
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