You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
used thop,torchstat and ptflops to caculate the Flops of the model, but all of the results shows there is 0 params and 0 flops in ResNet and FPN. Why did this happen and how can I calucalte the Flops of model correctly. Thank you!
used thop,torchstat and ptflops to caculate the Flops of the model, but all of the results shows there is 0 params and 0 flops in ResNet and FPN. Why did this happen and how can I calucalte the Flops of model correctly. Thank you!
The example of output of the pyflops:
Warning: module Conv2d is treated as a zero-op.
Warning: module FrozenBatchNorm2d is treated as a zero-op.
Warning: module StemWithFixedBatchNorm is treated as a zero-op.
Warning: module BottleneckWithFixedBatchNorm is treated as a zero-op.
Warning: module ResNet is treated as a zero-op.
Warning: module GeneralizedRCNN is treated as a zero-op.
GeneralizedRCNN(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(backbone): ResNet(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(stem): StemWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(layer1): Sequential(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(0): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(downsample): Sequential(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(0): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 64, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 64, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 64, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(1): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 64, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(2): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 64, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
)
(layer2): Sequential(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(0): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(downsample): Sequential(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(0): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 512, kernel_size=(1, 1), stride=(2, 2), bias=False)
(1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 128, kernel_size=(1, 1), stride=(2, 2), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 128, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(1): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 512, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 128, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(2): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 512, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 128, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(3): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 512, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 128, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
)
(layer3): Sequential(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(0): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(downsample): Sequential(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(0): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 512, 1024, kernel_size=(1, 1), stride=(2, 2), bias=False)
(1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 512, 256, kernel_size=(1, 1), stride=(2, 2), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(1): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 1024, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(2): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 1024, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(3): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 1024, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(4): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 1024, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(5): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 1024, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 256, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
)
(layer4): Sequential(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(0): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(downsample): Sequential(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(0): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 1024, 2048, kernel_size=(1, 1), stride=(2, 2), bias=False)
(1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 1024, 512, kernel_size=(1, 1), stride=(2, 2), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 512, 2048, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(1): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 2048, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 512, 2048, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
(2): BottleneckWithFixedBatchNorm(
0, 0.000% Params, 0.0 Mac, 0.000% MACs,
(conv1): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 2048, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv2): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
(conv3): Conv2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, 512, 2048, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): FrozenBatchNorm2d(0, 0.000% Params, 0.0 Mac, 0.000% MACs, )
)
)
)
)
0.0 Mac
The text was updated successfully, but these errors were encountered: