Eric-mingjie / network-slimming

Network Slimming (Pytorch) (ICCV 2017)
MIT License
909 stars 214 forks source link

Question about flops calculation #15

Closed radenmuaz closed 5 years ago

radenmuaz commented 5 years ago

https://arxiv.org/pdf/1708.06519.pdf How do you calculate table 1 FLOPs?

I use https://github.com/Lyken17/pytorch-OpCounter to calculate baseline vggnet (vgg-19) flops, I got 399718400.0

However Network Slimming paper says 7.97×10e8 -- almost double the flops

If I apply this flops counter to vgg-16, I got matching result with layerwise flops from L1 Pruning ConvNet paper https://arxiv.org/abs/1608.08710

radenmuaz commented 5 years ago

I found the solution, the function multiply_adds is set to True, so flops is doubled.