You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case if we apply RandomCrop(256) on images smaller than 256, current error message does not provide the information about size mismatch
import torchvision.transforms as T
t = T.RandomCrop(224)
t(torch.randint(0, 256, size=(3, 32, 32), dtype=torch.uint8))
>
File "/user/lib/python3.7/site-packages/torchvision/transforms/transforms.py", line 575, in forward
i, j, h, w = self.get_params(img, self.size)
File "/user/lib/python3.7/site-packages/torchvision/transforms/transforms.py", line 538, in get_params
i = torch.randint(0, h - th + 1, size=(1, )).item()
RuntimeError: random_ expects 'from' to be less than 'to', but got from=0 >= to=-191
It would be nice to have a more user-friendly error message if h - th + 1 < 0 saying that we have a size mismatch.
🚀 Feature
In case if we apply
RandomCrop(256)
on images smaller than 256, current error message does not provide the information about size mismatchIt would be nice to have a more user-friendly error message if
h - th + 1 < 0
saying that we have a size mismatch.cc @vfdev-5
The text was updated successfully, but these errors were encountered: