Mahtab
Mahtab

Reputation: 11

different size of images coco dataset

I load coco dataset then I use transform to resize images for creating dataloader. But I face 2 errors error 1 : RuntimeError: Trying to resize storage that is not resizable error 2 : RuntimeError: stack expects each tensor to be equal size, but got [3, 480, 640] at entry 0 and [3, 500, 500] at entry 1

I think resize transform can not be applied to images.

Does anybody know the reason?

Upvotes: 1

Views: 1012

Answers (1)

First error indicates there are some issues with your dataset. Take a look at your dataset. Try load samples one by one and check if there are some corrupted images.

The second error seems that is thrown from pytorch dataloader. The error is obvious by itself. As suggested here, try to use transforms.Resize like this: transforms.Resize((img_size, img_size))

Upvotes: 0

Related Questions