Skip to content

Flops of Swin Transformer #142

Open
Open
@AiHaiHai

Description

@AiHaiHai

The FLOPs of swin_t is 4.5G, but I get 3.13G here. Am I using it the wrong way?

import torchvision.models as models
from ptflops import get_model_complexity_info

net = models.swin_t(num_classes=1000)
macs, params = get_model_complexity_info(net, (3, 224, 224), as_strings=True, print_per_layer_stat=False)
print('{:<30}  {:<8}'.format('Computational complexity: ', macs))
print('{:<30}  {:<8}'.format('Number of parameters: ', params))
Computational complexity:       3.13 GMac
Number of parameters:           28.29 M 

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions