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

Doubts about the networks parameters and FLOPs #39

Open
kravrolens opened this issue Feb 23, 2023 · 1 comment
Open

Doubts about the networks parameters and FLOPs #39

kravrolens opened this issue Feb 23, 2023 · 1 comment

Comments

@kravrolens
Copy link

Hi, Fancy! Thanks for your excellent work.

StyleSwin synthesizes a 1024x1024 image with 40.86M params and 50.90B FLOPs, as shown in the paper of Table 6.

But I reproduced the results by running:

from thop import profile
flops, params = profile(generator, (noise,))             # noise: torch.Size([1, 512])
print('flops: ', flops / 1000000000, 'params: ', params / 1000000)
flops, params = profile(discriminator, (real_img,))  # real_img: torch.Size([1, 3, 1024, 1024])
print('flops: ', flops / 1000000000, 'params: ', params / 1000000)

The generator params are 28.28M with 47.36B FLOPs.
The discriminator params are 27.73M with 50.19B FLOPs.

I don't know where the problem is. Looking forward to your reply!

@ForeverFancy
Copy link
Contributor

It is because thop does not recognize costome operates like EqualConv, so it will not take these parameters into account. Therefore, we recommand to calculate the params and FLOPs using provided code. Thanks.

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