Instructions to use google/vit-base-patch16-224-in21k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/vit-base-patch16-224-in21k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="google/vit-base-patch16-224-in21k")# Load model directly from transformers import AutoImageProcessor, AutoModel processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224-in21k") model = AutoModel.from_pretrained("google/vit-base-patch16-224-in21k") - Notebooks
- Google Colab
- Kaggle
Unknown error related to channel dimensions
#12
by deleted - opened
I was training the VIT for image classification of skin cancer images.
When I just started training the model, I was getting this error.
ValueError: Make sure that the channel dimension of the pixel values match with the one set in the configuration. Expected 3 but got 224.
But my images are as desired.
ISIC_holdout['train'][0]['pixel_values'].shape
(224, 224, 3)
Please help me how to resolve the error. I should meet the deadline of my competition and resolving this error is very crucial.