Skip to content

Use pixtral processor found AttributeError: 'AvifImageFile' object has no attribute '_decoder' #64

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

Open
sdbds opened this issue Nov 1, 2024 · 1 comment
Labels
question Further information is requested

Comments

@sdbds
Copy link

sdbds commented Nov 1, 2024

pillow==10.2.0
pillow-avif-plugin==1.4.6

Traceback (most recent call last):
  File "E:\Code\pixtral\test.py", line 265, in <module>
    process_batch(args.train_data_dir, args.systemprompt, args.api_key, args.dir_name, args.model_path)
  File "E:\Code\pixtral\test.py", line 72, in process_batch
    inputs = processor(images=images, text=prompts, return_tensors="pt").to(
  File "E:\Code\pixtral\.venv\lib\site-packages\transformers\models\pixtral\processing_pixtral.py", line 218, in __call__
    images = [[load_image(im) for im in sample] for sample in images]
  File "E:\Code\pixtral\.venv\lib\site-packages\transformers\models\pixtral\processing_pixtral.py", line 218, in <listcomp>
    images = [[load_image(im) for im in sample] for sample in images]
  File "E:\Code\pixtral\.venv\lib\site-packages\transformers\models\pixtral\processing_pixtral.py", line 218, in <listcomp>
    images = [[load_image(im) for im in sample] for sample in images]
  File "E:\Code\pixtral\.venv\lib\site-packages\transformers\image_utils.py", line 383, in load_image
    image = PIL.ImageOps.exif_transpose(image)
  File "E:\Code\pixtral\.venv\lib\site-packages\PIL\ImageOps.py", line 617, in exif_transpose
    image.load()
  File "E:\Code\pixtral\.venv\lib\site-packages\pillow_avif\AvifImagePlugin.py", line 95, in load
    data, timescale, tsp_in_ts, dur_in_ts = self._decoder.get_frame(
AttributeError: 'AvifImageFile' object has no attribute '_decoder'
@fdintino
Copy link
Owner

fdintino commented Mar 5, 2025

Are the PIL Image objects here being created in a standard way? If they came from a call to PIL.Image.open then this AttributeError shouldn't be possible.

@fdintino fdintino added the question Further information is requested label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants