NielsRogge / Transformers-Tutorials

This repository contains demos I made with the Transformers library by HuggingFace.
MIT License
9.17k stars 1.42k forks source link

Size should be int or sequence. Got <class 'dict'> (Fine-tuning ViT on CIFAR-10) #255

Closed marcospgp closed 1 year ago

marcospgp commented 1 year ago

The notebook

https://github.com/NielsRogge/Transformers-Tutorials/blob/master/VisionTransformer/Fine_tuning_the_Vision_Transformer_on_CIFAR_10_with_the_%F0%9F%A4%97_Trainer.ipynb

does not run successfully.

Edit: Replacing feature_extractor.size in the transforms section with size, defined as

size = (feature_extractor.size["height"], feature_extractor.size["width"])

seems to have worked!

NielsRogge commented 1 year ago

Thanks for reporting, I've updated my notebook since size is now a dictionary rather than an integer.