Fix tests for vision models
Author: qubvel
Pull request: yes
Labels: name: Tests

name: Vision

name: run-slow

# What does this PR do?

Fixing tests for vision models

## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @ylacombe, @eustlb
- graph models: @clefourrier

Library:

- flax: @sanchit-gandhi
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @muellerzr and @SunMarc
- chat templates: @Rocketknight1

Integrations:

- deepspeed: HF Trainer/Accelerate: @muellerzr
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber

Documentation: @stevhliu

HF projects:

- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Maintained examples (not research project or legacy):

- Flax: @sanchit-gandhi
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1

 -->


Comments:
run-slow: beit, detr, dinov2, vit, textnet

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_35654). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Hi @qubvel, I'm not sure what this draft pr intends to do, however it might be relevant to the pr #35138. That pr fixes the incompatibility of FlaxDinov2 with batch sizes of more than 1. This error could not be detected by the flax tests (same as the pytorch tests), when I first contributed this model. All the slow tests in transformers simply pass a single image with a batch size of 1 and that is why such batch sizes incompatibility errors might not be detected. As a result, I changed the images batch size to 2 for the flax dinov2 slow tests (in that pr, not yet merged). Probably, doing the same for all the other future model slow tests would greatly assist the development process. Also, may I request a review on pr #35138 so that FlaxDinov2 can be used properly.

run-slow: beit, detr, dinov2, vit, textnet

This comment contains run-slow, running the specified jobs: ['models/beit', 'models/detr', 'models/dinov2', 'models/textnet', 'models/vit'] ...

run-slow: beit, detr, dinov2, vit, textnet

This comment contains run-slow, running the specified jobs: ['models/beit', 'models/detr', 'models/dinov2', 'models/textnet', 'models/vit'] ...

run-slow: beit, detr, dinov2, vit, textnet

This comment contains run-slow, running the specified jobs: ['models/beit', 'models/detr', 'models/dinov2', 'models/textnet', 'models/vit'] ...

run-slow: beit, data2vec, dpt

This comment contains run-slow, running the specified jobs: ['models/beit', 'models/data2vec', 'models/dpt'] ...

run-slow: detr

This comment contains run-slow, running the specified jobs: ['models/detr'] ...

run-slow: beit, detr, dinov2, vit, textnet, data2vec, dpt

This comment contains run-slow, running the specified jobs: ['models/beit', 'models/data2vec', 'models/detr', 'models/dinov2', 'models/dpt', 'models/textnet', 'models/vit'] ...

run-slow: beit, detr, dinov2, vit, textnet, data2vec, dpt

This comment contains run-slow, running the specified jobs: ['models/beit', 'models/data2vec', 'models/detr', 'models/dinov2', 'models/dpt', 'models/textnet', 'models/vit'] ...

run-slow: beit, data2vec, dpt, zoedepth

This comment contains run-slow, running the specified jobs: ['models/beit', 'models/data2vec', 'models/dpt', 'models/zoedepth'] ...

run-slow: beit, data2vec, dpt, zoedepth, detr, dinov2, vit, textnet

This comment contains run-slow, running the specified jobs: ['models/beit', 'models/data2vec', 'models/detr', 'models/dinov2', 'models/dpt', 'models/textnet', 'models/vit', 'models/zoedepth'] ...

cc @ArthurZucker for review