Keras_FLOP_Estimator
Keras_FLOP_Estimator copied to clipboard
A probelm about factor when calculating the FLOPs of DepthwiseConv2D?
when calulating the FLOPs of DW conv, the results was divide by a factor (1000000) ?
flops = 2 * ((ks[0] * ks[1] * i_shape[2]) * ((i_shape[0] / strides[0]) * (i_shape[1] / strides[1]))) / factor ?
when the FlOPs of all layers were calculated, the totoal FLOPs would divided the factor again ?
Becasue i found that when increasing the kernel size of DW conv, the FLOPs has no change. So i check the code and the output. when the input feature map is (13, 13, 512), the kernel size of DW conv is 3, the FLOPs is only 1.5575. i think it is a bug? i want to identify it from you.
Hi,
Yes it seems that indeed there is an error there. The variable factor is used for scaling so it should only be applied once at the end. I corrected the code if you wish to test it again.
Ok! Thank you.
---- Replied Message ---- | From | Christos @.> | | Date | 05/16/2022 18:44 | | To | @.> | | Cc | @.@.> | | Subject | Re: [ckyrkou/Keras_FLOP_Estimator] A probelm about factor when calculating the FLOPs of DepthwiseConv2D? (Issue #6) |
Hi,
Yes it seems that indeed there is an error there. The variable factor is used for scaling so it should only be applied once at the end. I corrected the code if you wish to test it again.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>