How to feed MNIST images into ImageProcessor?

#3
by IICurious - opened

Hey. I have some problem using ViT (which is pre-trained on ImageNet) to fine-tune MNIST.
It is because MNIST is of channel 1, while the ImageProcessor for ViT requires channel of 3. There will be mismatch in normalizing the images.

The error msg is ValueError: mean must have 1 elements if it is an iterable, got 3.

Do you have any ideas? Maybe I should expand the MNIST to 3-dimension before i feed the images to ImageProcessor? or should i modify the mean/std in ImageProcessor?

Hey. I have some problem using ViT (which is pre-trained on ImageNet) to fine-tune MNIST.
It is because MNIST is of channel 1, while the ImageProcessor for ViT requires channel of 3. There will be mismatch in normalizing the images.

The error msg is ValueError: mean must have 1 elements if it is an iterable, got 3.

Do you have any ideas? Maybe I should expand the MNIST to 3-dimension before i feed the images to ImageProcessor? or should i modify the mean/std in ImageProcessor?

Any update on solution?

Sign up or log in to comment