FLOPS of static quantized CNN by pthflops

Hi everone,

I am trying to calculated the FLOPS of my Static Quantized model by pthflops library of Pytorch but it fails, do U have any idea how to calculate it ? (it works for normal model)

from pthflops import count_ops
rand_image = torch.rand(1, 3, 96, 96)
count_ops(quantized_net, rand_image)

error :

StopIteration                             Traceback (most recent call last)
<ipython-input-43-9cbbf57752cb> in <module>
----> 1 count_ops(q_net, rand_image)

~/anaconda3/envs/py36/lib/python3.6/site-packages/pthflops/ops.py in count_ops(model, input, custom_ops, ignore_layers, print_readable, verbose, *args)
    203     """
    204     # Make sure that the input is on the same device as the model
--> 205     if next(model.parameters()).device != input.device:
    206         input.to(next(model.parameters()).device)

1 Like