Image classification script overrides preprocessing configuration with script defaults
Author: LysandreJik
Pull request: no

As observed by @stas00 when working on the DeepSpeed model zoo, the image classification script overrides the preprocessor configuration values with the script defaults.

Running the following command:
```
python examples/pytorch/image-classification/run_image_classification.py 
    --output_dir output_dir 
    --model_name_or_path hf-internal-testing/tiny-random-vit 
    --dataset_name hf-internal-testing/cats_vs_dogs_sample 
    --do_train 
    --do_eval 
    --learning_rate 1e-4 
    --per_device_train_batch_size 2 
    --per_device_eval_batch_size 1 
    --remove_unused_columns False 
    --overwrite_output_dir True 
    --dataloader_num_workers 16
    --metric_for_best_model accuracy 
    --max_steps 10 
    --train_val_split 0.1 
    --seed 42
```

Will result in the following error:

```
Traceback (most recent call last):
  File "examples/pytorch/image-classification/run_image_classification.py", line 360, in <module>
    main()
  File "examples/pytorch/image-classification/run_image_classification.py", line 334, in main
    train_result = trainer.train(resume_from_checkpoint=checkpoint)
  File "/home/lysandre/Workspaces/Python/transformers/src/transformers/trainer.py", line 1302, in train
    tr_loss_step = self.training_step(model, inputs)
  File "/home/lysandre/Workspaces/Python/transformers/src/transformers/trainer.py", line 1817, in training_step
    loss = self.compute_loss(model, inputs)
  File "/home/lysandre/Workspaces/Python/transformers/src/transformers/trainer.py", line 1849, in compute_loss
    outputs = model(**inputs)
  File "/home/lysandre/Workspaces/Python/transformers/.env/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/lysandre/Workspaces/Python/transformers/src/transformers/models/vit/modeling_vit.py", line 642, in forward
    outputs = self.vit(
  File "/home/lysandre/Workspaces/Python/transformers/.env/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/lysandre/Workspaces/Python/transformers/src/transformers/models/vit/modeling_vit.py", line 543, in forward
    embedding_output = self.embeddings(pixel_values, interpolate_pos_encoding=interpolate_pos_encoding)
  File "/home/lysandre/Workspaces/Python/transformers/.env/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/lysandre/Workspaces/Python/transformers/src/transformers/models/vit/modeling_vit.py", line 112, in forward
    embeddings = self.patch_embeddings(pixel_values, interpolate_pos_encoding=interpolate_pos_encoding)
  File "/home/lysandre/Workspaces/Python/transformers/.env/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/lysandre/Workspaces/Python/transformers/src/transformers/models/vit/modeling_vit.py", line 152, in forward
    raise ValueError(
ValueError: Input image size (224*224) doesn't match model (30*30).
```

Updating the script command to include `--image_size=30` works - but the configuration of that model is already set to 30: https://huggingface.co/hf-internal-testing/tiny-random-vit/blob/main/preprocessor_config.json#L16

cc @NielsRogge @nateraw 

Comments: