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

why the params size of b0 model is 20M rather than 5.3M #40

Closed
lightfate opened this issue Jun 26, 2019 · 3 comments
Closed

why the params size of b0 model is 20M rather than 5.3M #40

lightfate opened this issue Jun 26, 2019 · 3 comments

Comments

@lightfate
Copy link

lightfate commented Jun 26, 2019

Hi, @lukemelas ~
I'm so excited about your code.
I have a question. You said that the Params size of the b0 model is 5.3M,but the size of pretrained model what you offered is 20.3M,
and then I test it through torchsummary, which shows that Params size (MB): 20.17, why?


#torchsummary code:
from efficientnet_pytorch import EfficientNet
modelBody= EfficientNet.from_pretrained('efficientnet-b2').to(device)
from torchsummary import summary
summary(modelBody, input_size=(3, 224, 224))


#result
Total params: 5,288,548
Trainable params: 5,288,548
Non-trainable params: 0
Input size (MB): 0.57
Forward/backward pass size (MB): 107.31
Params size (MB): 20.17
Estimated Total Size (MB): 128.06


@lukemelas
Copy link
Owner

5.3M refers to the number of parameters, whereas 20 refers to the size of the params in megabytes. It makes sense that it's around 4 times the number of params.

@lukemelas
Copy link
Owner

Closing this.

@EtheneXiang
Copy link

torchsummary

one para's type is float32 = 4 * int8 = 32bit
so 5,288,548 * 4 = 20.17MB
that's all

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