# Changing resolution of transformer models for training

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchanging-resolution-of-transformer-models-for-training%2F22439%3E%5C
**Category:** 🤗Transformers\
**Created:** [September 2, 2022, 3:53am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchanging-resolution-of-transformer-models-for-training%2F22439 "2022-09-02T03:53:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![moshel](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@moshel](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmoshel)%5C
**Post date:** [September 2, 2022, 3:53am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchanging-resolution-of-transformer-models-for-training%2F22439%2F1 "2022-09-02T03:53:26Z")

</div>

I would like to train a transformer on images 512x512. I was looking at the huggingpics notebook as a starting point but failed to modify it to train on images with size different from 224x224.  
I tried adding the “size” to ViTFeatureExtractor.from\_pretrained (unknown keyword) and to ViTForImageClassification.from\_pretrained (passed, but when it reached the trainer.fit fails with “ValueError: Input image size (512_512) doesn’t match model (224_224).”).

While i know how to do that in plain vanilla keras and pytorch, the hugginingface is just too user friendly for me!

Any help will be greatly appreciated.
