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.
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.
!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?