# How do I change image size and patch size in Tensorflow

**URL:** <https://discuss.huggingface.co/t/how-do-i-change-image-size-and-patch-size-in-tensorflow/65783>\
**Category:** Beginners\
**Created:** [December 14, 2023, 8:01am UTC](https://discuss.huggingface.co/t/how-do-i-change-image-size-and-patch-size-in-tensorflow/65783 "2023-12-14T08:01:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MuawizC](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@MuawizC](https://discuss.huggingface.co/u/MuawizC)\
**Post date:** [December 14, 2023, 8:01am UTC](https://discuss.huggingface.co/t/how-do-i-change-image-size-and-patch-size-in-tensorflow/65783/1 "2023-12-14T08:01:59Z")

</div>

Hi all, I want to change the patch embedding layer of my ViT model for differently sized images on tensorflow. I get the following error.

```auto
TypeError: Dimension value must be integer or None or have an __index__ method, got value '(12, 16)' with type '<class tuple>'

```

I use the following code.

```auto
!pip install -q tensorflow==2.13.0
!pip install -q transformers==4.36.0

import transformers
import tensorflow
import keras

model_name = "google/vit-base-patch16-224"
config = transformers.ViTConfig.from_pretrained(model_name)
config.image_size=(12,16)
model = transformers.TFViTForImageClassification.from_pretrained(model_name, config=config)

```

This is not an issue on the pytorch version of HuggingFaces.

How do I solve this issue?
