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

Failed to load relative path images for multimodality models #7280

Open
1 task done
shaowei-su opened this issue Mar 13, 2025 · 0 comments
Open
1 task done

Failed to load relative path images for multimodality models #7280

shaowei-su opened this issue Mar 13, 2025 · 0 comments
Labels
bug Something isn't working pending This problem is yet to be addressed

Comments

@shaowei-su
Copy link

shaowei-su commented Mar 13, 2025

Reminder

  • I have read the above rules and searched the existing issues.

System Info

[2025-03-13 01:39:21,513] [INFO] [real_accelerator.py:219:get_accelerator] Setting ds_accelerator to cuda (auto detect)

- `llamafactory` version: 0.9.1
- Platform: Linux-5.15.149-99.162.amzn2.x86_64-x86_64-with-glibc2.35
- Python version: 3.11.10
- PyTorch version: 2.4.1.post302 (GPU)
- Transformers version: 4.46.1
- Datasets version: 3.1.0
- Accelerate version: 1.0.1
- PEFT version: 0.12.0
- TRL version: 0.9.6
- GPU type: NVIDIA A100-SXM4-80GB
- DeepSpeed version: 0.15.4
- Bitsandbytes version: 0.44.1

Reproduction

Run example (https://github.com/hiyouga/LLaMA-Factory/blob/v0.9.2/examples/train_lora/qwen2vl_lora_sft.yaml) where the training arg `dataset_dir` is absolute path not under current directory.

Sample error logs:

  File "/mnt/conda-volume//lib/python3.11/site-packages/datasets/arrow_dataset.py", line 3073, in map
    for rank, done, content in Dataset._map_single(**dataset_kwargs):
  File "/mnt/conda-volume//lib/python3.11/site-packages/datasets/arrow_dataset.py", line 3476, in _map_single
    batch = apply_function_on_filtered_inputs(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/conda-volume//lib/python3.11/site-packages/datasets/arrow_dataset.py", line 3338, in apply_function_on_filtered_inputs
    processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/conda-volume//lib/python3.11/site-packages/llamafactory/data/processor/supervised.py", line 99, in preprocess_dataset
    input_ids, labels = self._encode_data_example(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/conda-volume//lib/python3.11/site-packages/llamafactory/data/processor/supervised.py", line 43, in _encode_data_example
    messages = self.template.mm_plugin.process_messages(prompt + response, images, videos, audios, self.processor)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/conda-volume//lib/python3.11/site-packages/llamafactory/data/mm_plugin.py", line 1131, in process_messages
    mm_inputs = self._get_mm_inputs(images, videos, audios, processor)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/conda-volume//lib/python3.11/site-packages/llamafactory/data/mm_plugin.py", line 1095, in _get_mm_inputs
    images = self._regularize_images(
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/conda-volume//lib/python3.11/site-packages/llamafactory/data/mm_plugin.py", line 161, in _regularize_images
    image = Image.open(image)
            ^^^^^^^^^^^^^^^^^
  File "/mnt/conda-volume//lib/python3.11/site-packages/PIL/Image.py", line 3465, in open
    fp = builtins.open(filename, "rb")
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'mllm_demo_data/1.jpg'

Others

No response

@shaowei-su shaowei-su added bug Something isn't working pending This problem is yet to be addressed labels Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending This problem is yet to be addressed
Projects
None yet
Development

No branches or pull requests

1 participant