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

Can this support StableDiffusion?

Open sunzhe09 opened this issue 1 year ago • 1 comments

sunzhe09 avatar May 23 '24 08:05 sunzhe09

It is not easy, we need to change CNN batch to a dict.

        if isinstance(input_sample, dict):
            _ = flops_model(**input_sample)
        else:
            _ = flops_model(input_sample)

and change a lot of operators. becuase diffusers has different op name. and even different version has different op names. for example.

class Attention(nn.Module):

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