diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

A bug in AdaLayerNorm

Open akstt opened this issue 1 year ago • 2 comments

Describe the bug

diffusers/blob/main/src/diffusers/models/normalization.py The default value of dim parameter of chunk function is 0. The shape of scale and the shape of x doesn't match.

Reproduction

The shape of scale and the shape of x doesn't match.

Logs

No response

System Info

This is still in the main branch.

Who can help?

No response

akstt avatar Mar 25 '24 03:03 akstt

Reproducible code snippet please.

sayakpaul avatar Mar 25 '24 10:03 sayakpaul

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Apr 24 '24 15:04 github-actions[bot]

Closing because of inactivity.

sayakpaul avatar Jun 29 '24 13:06 sayakpaul

Here is a reproducable code

import torch
from diffusers.models.normalization import AdaLayerNorm

bs = 32
dim = 100
num_steps = 1000
x = torch.randn(bs, dim)
t = torch.randint(0, num_steps, (bs,))
norm = AdaLayerNorm(dim, num_steps)
output = norm(x, t)

Log

  File "normalization.py", line 47, in forward
    x = self.norm(x) * (1 + scale) + shift
RuntimeError: The size of tensor a (100) must match the size of tensor b (200) at non-singleton dimension 1

mohamedhassanmus avatar Jul 25 '24 11:07 mohamedhassanmus