Skip to content

IndexError: index 1 is out of bounds for dimension 0 with size 1 #56

@raj7AIfrac

Description

@raj7AIfrac

While runing the Qwen edit (plus) model with test_example_qwen_image_edit_plus_fp16.yaml on multi GPU.
I am getting this error.

[rank7]: Traceback (most recent call last): [rank7]: File "<frozen runpy>", line 198, in _run_module_as_main [rank7]: File "<frozen runpy>", line 88, in _run_code [rank7]: File "/weka/innmivfractalslurmh1/home/raj.yadav/Work/Task3/Features/qwen-image-finetune/src/qflux/main.py", line 99, in <module> [rank7]: main() [rank7]: File "/weka/innmivfractalslurmh1/home/raj.yadav/Work/Task3/Features/qwen-image-finetune/src/qflux/main.py", line 95, in main [rank7]: trainer.fit(train_dataloader) [rank7]: File "/weka/innmivfractalslurmh1/home/raj.yadav/Work/Task3/Features/qwen-image-finetune/src/qflux/trainer/base_trainer.py", line 648, in fit [rank7]: self.train_epoch(epoch, train_dataloader) [rank7]: File "/weka/innmivfractalslurmh1/home/raj.yadav/Work/Task3/Features/qwen-image-finetune/src/qflux/trainer/base_trainer.py", line 522, in train_epoch [rank7]: loss = self.training_step(batch) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "/weka/innmivfractalslurmh1/home/raj.yadav/Work/Task3/Features/qwen-image-finetune/src/qflux/trainer/base_trainer.py", line 461, in training_step [rank7]: return self._training_step_compute(batch) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "/weka/innmivfractalslurmh1/home/raj.yadav/Work/Task3/Features/qwen-image-finetune/src/qflux/trainer/base_trainer.py", line 470, in _training_step_compute [rank7]: embeddings = self.prepare_embeddings(batch, stage="fit") [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "/weka/innmivfractalslurmh1/home/raj.yadav/Work/Task3/Features/qwen-image-finetune/src/qflux/trainer/qwen_image_edit_plus_trainer.py", line 188, in prepare_embeddings [rank7]: prompt_embeds, prompt_embeds_mask = self.encode_prompt(prompt=batch["prompt"], image=condition_images) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "/weka/innmivfractalslurmh1/home/raj.yadav/Work/Task3/Features/qwen-image-finetune/src/qflux/trainer/qwen_image_edit_plus_trainer.py", line 312, in encode_prompt [rank7]: prompt_embeds, prompt_embeds_mask = self._get_qwen_prompt_embeds(prompt, image, device) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "/weka/innmivfractalslurmh1/home/raj.yadav/Work/Task3/Features/qwen-image-finetune/src/qflux/trainer/qwen_image_edit_plus_trainer.py", line 346, in _get_qwen_prompt_embeds [rank7]: model_inputs = self.processor( [rank7]: ^^^^^^^^^^^^^^^ [rank7]: File "/weka/innmivfractalslurmh1/home/raj.yadav/Work/Task3/qwen-image-finetune/venv1/lib/python3.12/site-packages/transformers/models/qwen2_vl/processing_qwen2_vl.py", line 159, in __call__ [rank7]: num_image_tokens = image_grid_thw[index].prod() // merge_length [rank7]: ~~~~~~~~~~~~~~^^^^^^^ [rank7]: IndexError: index 1 is out of bounds for dimension 0 with size 1``

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions