calculate-flops.pytorch icon indicating copy to clipboard operation
calculate-flops.pytorch copied to clipboard

Library `diffusers` is not supported yet

Open XianweiC opened this issue 2 years ago • 3 comments

I was trying to calculate the flops of InstructPix2Pix from huggingface using the method described in the README, but I got this error:

ValueError: Library `diffusers` is not supported yet, please open an issue on GitHub for us to add support.

The code that I use:

    from calflops import calculate_flops_hf

    H, W = 128, 512
    model_name = "timbrooks/instruct-pix2pix"

   flops, macs, params = calculate_flops_hf(model_name=model_name, input_shape=(batch_size, 3, H, W))
   print("%s FLOPs:%s  MACs:%s  Params:%s \n" %(model_name, flops, macs, params))

XianweiC avatar Nov 22 '23 07:11 XianweiC

I'm having the same problem and I'd like to know when this function will be available, any help would be greatly appreciated!

Jiawei804 avatar Jan 09 '24 02:01 Jiawei804

Sorry. The calflops don't support diffuse model for the time being. I will consider supporting such diffuse models in the future when I have time. Thank you for your good suggestion.

MrYxJ avatar Jun 07 '24 11:06 MrYxJ

For Unet, you could refer https://github.com/MrYxJ/calculate-flops.pytorch/issues/23#issuecomment-2522025272

LukeLIN-web avatar Dec 06 '24 03:12 LukeLIN-web