facebookresearch / facebookresearch/fvcore
DeformConv2d not supported in FLOPs counting?
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 236
- PR merge metrics
- No merged PRs in 30d
Description
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.
```python
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,) | |
```
Contributor guide
Assessment
This issue has not been assessed yet.