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

DeformConv2d not supported in FLOPs counting? #121

Open
kenmbkr opened this issue Nov 21, 2022 · 2 comments
Open

DeformConv2d not supported in FLOPs counting? #121

kenmbkr opened this issue Nov 21, 2022 · 2 comments

Comments

@kenmbkr
Copy link

kenmbkr commented Nov 21, 2022

I tested flop counting for DeformConv2d and I am getting 0 for flops.
The code to reproduce is as follows.
Please kindly advise how to get the correct FLOPs.

import torch
from fvcore.nn import FlopCountAnalysis, flop_count_table
from torchvision.ops import DeformConv2d

kernel_size = 3
conv = DeformConv2d(64, 64, kernel_size=kernel_size, padding=1)
x = torch.randn(1, 64, 64, 64)
offset = torch.randn(1, 2 * kernel_size * kernel_size, 64, 64)

flops = FlopCountAnalysis(conv, (x, offset))
print(flop_count_table(flops, max_depth=1))
| module   | #parameters or shape   | #flops   |
|:---------|:-----------------------|:---------|
| model    | 36.928K                | 0        |
|  weight  |  (64, 64, 3, 3)        |          |
|  bias    |  (64,)                 |          |
@ppwwyyxx
Copy link
Contributor

print(flops.unsupported_ops()) will show that deform_conv was encountered once in the model but unsupported (because its formula was not included).

@kenmbkr
Copy link
Author

kenmbkr commented Nov 22, 2022

print(flops.unsupported_ops()) will show that deform_conv was encountered once in the model but unsupported (because its formula was not included).

@ppwwyyxx Thank you for the confirmation. Are there any plans to support it in the future?

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