calculate-flops.pytorch
calculate-flops.pytorch copied to clipboard
Library `diffusers` is not supported yet
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))
I'm having the same problem and I'd like to know when this function will be available, any help would be greatly appreciated!
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.
For Unet, you could refer https://github.com/MrYxJ/calculate-flops.pytorch/issues/23#issuecomment-2522025272