Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: The size of tensor a (128) must match the size of tensor b (2) at non-singleton dimension 6 #21

Closed
everythoughthelps opened this issue Oct 14, 2024 · 2 comments

Comments

@everythoughthelps
Copy link

Got the size matching error:
Traceback (most recent call last):
File "/data4/panmeng/flux_ctrl_inpainting/main.py", line 38, in
result = pipe(
File "/home/panmeng/miniconda3/envs/flux_inpainting/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "/data4/panmeng/flux_ctrl_inpainting/pipeline_flux_controlnet_inpaint.py", line 959, in call
) = self.controlnet(
File "/home/panmeng/miniconda3/envs/flux_inpainting/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/panmeng/miniconda3/envs/flux_inpainting/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
File "/data4/panmeng/flux_ctrl_inpainting/controlnet_flux.py", line 329, in forward
encoder_hidden_states, hidden_states = block(
File "/home/panmeng/miniconda3/envs/flux_inpainting/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/panmeng/miniconda3/envs/flux_inpainting/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
File "/data4/panmeng/flux_ctrl_inpainting/transformer_flux.py", line 213, in forward
attn_output, context_attn_output = self.attn(
File "/home/panmeng/miniconda3/envs/flux_inpainting/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/panmeng/miniconda3/envs/flux_inpainting/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
File "/home/panmeng/miniconda3/envs/flux_inpainting/lib/python3.9/site-packages/diffusers/models/attention_processor.py", line 490, in forward
return self.processor(
File "/home/panmeng/miniconda3/envs/flux_inpainting/lib/python3.9/site-packages/diffusers/models/attention_processor.py", line 1762, in call
query = apply_rotary_emb(query, image_rotary_emb)
File "/home/panmeng/miniconda3/envs/flux_inpainting/lib/python3.9/site-packages/diffusers/models/embeddings.py", line 680, in apply_rotary_emb
out = (x.float() * cos + x_rotated.float() * sin).to(x.dtype)
RuntimeError: The size of tensor a (128) must match the size of tensor b (2) at non-singleton dimension 6,
any one soloved?

@1058441072
Copy link

+1

@JPlin
Copy link
Collaborator

JPlin commented Oct 14, 2024

Same problem #7

@JPlin JPlin closed this as completed Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants