ValueError: Unrecognized image processor in Qwen/Qwen2.5-VL-3B-Instruct.
Author: SkalskiP
Pull request: no
Labels: name: bug

### System Info

- transformers 4.49.0.dev0
- Python 3.11.11

### Reproduction

I follow model instructions from [here](https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct).

1. install `transformers` from GH 

```bash
pip install git+https://github.com/huggingface/transformers
```

2. laod `Qwen/Qwen2.5-VL-3B-Instruct` or `Qwen/Qwen2.5-VL-7B-Instruct`; I did not tested with others 

```python
from transformers import AutoProcessor

processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-3B-Instruct")
```

3. it raise exception

```
ValueError: Unrecognized image processor in Qwen/Qwen2.5-VL-3B-Instruct. Should have a `image_processor_type` key in its preprocessor_config.json of config.json, or one of the following `model_type` keys in its config.json: align, aria, beit, bit, blip, blip-2, bridgetower, chameleon, chinese_clip, clip, clipseg, conditional_detr, convnext, convnextv2, cvt, data2vec-vision, deformable_detr, deit, depth_anything, depth_pro, deta, detr, dinat, dinov2, donut-swin, dpt, efficientformer, efficientnet, flava, focalnet, fuyu, git, glpn, got_ocr2, grounding-dino, groupvit, hiera, idefics, idefics2, idefics3, ijepa, imagegpt, instructblip, instructblipvideo, kosmos-2, layoutlmv2, layoutlmv3, levit, llava, llava_next, llava_next_video, llava_onevision, mask2former, maskformer, mgp-str, mllama, mobilenet_v1, mobilenet_v2, mobilevit, mobilevitv2, nat, nougat, oneformer, owlv2, owlvit, paligemma, perceiver, pix2struct, pixtral, poolformer, pvt, pvt_v2, qwen2_5_vl, qwen2_vl, regnet, resnet, rt_detr, sam, segformer, seggpt, siglip, superglue, swiftformer, swin, swin2sr, swinv2, table-transformer, timesformer, timm_wrapper, tvlt, tvp, udop, upernet, van, videomae, vilt, vipllava, vit, vit_hybrid, vit_mae, vit_msn, vitmatte, xclip, yolos, zoedepth
```

### Expected behavior

processor loads without exceptions

Comments:
When installing `pip install git+https://github.com/huggingface/transformers.git@1931a351408dbd1d0e2c4d6d7ee0eb5e8807d7bf` `AutoProcessor` works. Looks like https://github.com/huggingface/transformers/commit/33d1d715b0260efc1c2df1c16d864186b5bb9437 might have broke it.

same problem

Delete   ```"image_processor_type": "Qwen2_5_VLImageProcessor"``` in Qwen2.5-VL-7B-Instruct/preprocessor_config.json could work.


update preprocessor_config.json, which is updated 2 days ago on huggingface

Hey all! Thanks for reporting this, I didn't see that the slow image processor was removed!

@ArthurZucker I believe the slow ones should stay for a while, at least until the fast ones become the default. The issue is fixed now by updating the hub files and forcing the model to use Qwen2VL slow processor (models have identical image processing)

I am facing this error while using unsloth for finetuning. Please post the solution in case anyone has got it.

```
model, tokenizer = FastVisionModel.from_pretrained(
    "Qwen/Qwen2.5-VL-3B-Instruct",
    load_in_4bit = True, # Use 4bit to reduce memory use. False for 16bit LoRA.
    use_gradient_checkpointing = "unsloth", # True or "unsloth" for long context
)
```

IMO no need for the slow, let's make sure this does not break for people as release is soon. The processor was introduced in the main branch only

I tried to pass `image_processor_type` in `kwargs` of [get_image_processor_dict](https://github.com/huggingface/transformers/blob/main/src/transformers/image_processing_base.py#L275), but this function doesn't use `image_processor_type` as a kwarg. Is that a bug?

The reason I am doing this is that this [preprocessor_config.json](https://huggingface.co/nm-testing/Qwen2.5-VL-7B-Instruct-FP8-Dynamic/blob/main/preprocessor_config.json) is still using `Qwen2_5_VLImageProcessor` and I am trying to overwrite it with `Qwen2VLImageProcessor`  via vLLM.


So just to understand it better, is the solution to update the image processor in _all_ derivative models, such as MLX ([search](https://huggingface.co/models?search=qwen2.5-vl%20mlx), [example](https://huggingface.co/mlx-community/Qwen2.5-VL-3B-Instruct-8bit/blob/ab564da7b09e45e6eb7b4949ab1cbc32891fe76e/preprocessor_config.json#L17)), fine-tunes and others?

And if so, this would only work on transformers >= 4.49.0, right?

cc @zucchini-nlp 

@pcuenca yep, that is the solution and it will work in all version is that case. The problem is we deleted the class for qwen2-5-vl, since it is identical to qwen2-vl before the release. So using qwen2-vl works for all models

And sorry for a breaking change

Thanks, no worries! I'll test a bit and then open PRs for the MLX repos.

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.

I have: Unrecognized Video processor for Qwen2.5-VL-3B . any ideas how to fix it?
I am restoring the model like this (I have just saved the adapters):

```
from unsloth import FastVisionModel
from pathlib import Path
model, tokenizer = FastVisionModel.from_pretrained(
    model_name = Path("./lora_model_qwen2.5-VL-3B/lora_model_qwen2.5-VL-3B/").resolve().absolute().as_posix(),
    load_in_4bit = True,
)
FastVisionModel.for_inference(model) # Enable for inference!
```

@ZihaoZheng98 it should

> Delete `"image_processor_type": "Qwen2_5_VLImageProcessor"` in Qwen2.5-VL-7B-Instruct/preprocessor_config.json could work.

Thank you very much！！It's very helpful！！