Error running the example code: RuntimeError: cannot reshape tensor of 0 elements into shape [1, 0, -1] because the unspecified dimension size -1 can be any value and is ambiguous

#17
by ivoras - opened

I'm getting this error while trying to run the example code on Windows with ROCm 7:

  File "C:\temp\qwenimage\gen.py", line 38, in <module>
    image = pipe(
            ^^^^^
  File "C:\temp\venvrocm7\Lib\site-packages\torch\utils\_contextlib.py", line 120, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\temp\venvrocm7\Lib\site-packages\diffusers\pipelines\qwenimage\pipeline_qwenimage.py", line 606, in __call__
    prompt_embeds, prompt_embeds_mask = self.encode_prompt(
                                        ^^^^^^^^^^^^^^^^^^^
  File "C:\temp\venvrocm7\Lib\site-packages\diffusers\pipelines\qwenimage\pipeline_qwenimage.py", line 261, in encode_prompt
    prompt_embeds = prompt_embeds.view(batch_size * num_images_per_prompt, seq_len, -1)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: cannot reshape tensor of 0 elements into shape [1, 0, -1] because the unspecified dimension size -1 can be any value and is ambiguous

Sign up or log in to comment