The project is an official implementation of our CVPR2019 paper "Deep High-Resolution Representation Learning for Human Pose Estimation"
4.34k
stars
915
forks
source link
Bugs in `get_model_summary' and flops calculation #257
Open
jin-s13 opened 3 years ago
Dear all,
Thanks for releasing the codes! I noticed some problems in model flops calculation.
Conv2d
andConvTranspose2d
both contain 'Conv', so their flops are counted inget_model_summary
. https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/blob/ba50a82dce412df97f088c572d86d7977753bf74/lib/utils/utils.py#L124However, the flops-calculation for
Conv2d
andConvTranspose2d
should be different.For
Conv2d
, it isflops = (torch.prod(torch.LongTensor(list(module.weight.data.size()))) * torch.prod(torch.LongTensor(list(output.size())[2:]))).item()
But for
ConvTranspose2d
, it should beflops = (torch.prod(torch.LongTensor(list(module.weight.data.size()))) * torch.prod(torch.LongTensor(list(input[0].size())[2:]))).item()