We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
float
padding
RandomCrop()
Setting a list of float type values to padding argument of RandomCrop() gets the indirect error message as shown below:
from torchvision.datasets import OxfordIIITPet from torchvision.transforms.v2 import RandomCrop my_data = OxfordIIITPet( root="data", # ↓↓↓↓↓↓↓↓↓↓↓↓ transform=RandomCrop(size=[100, 200], padding=[10.8, 20.3]) ) my_data[0][0] # Error
TypeError: randint() received an invalid combination of arguments - got (int, float, size=tuple), but expected one of: * (int high, tuple of ints size, *, torch.Generator generator, Tensor out = None, torch.dtype dtype = None, torch.layout layout = None, torch.device device = None, bool pin_memory = False, bool requires_grad = False) * (int high, tuple of ints size, *, Tensor out = None, torch.dtype dtype = None, torch.layout layout = None, torch.device device = None, bool pin_memory = False, bool requires_grad = False) * (int low, int high, tuple of ints size, *, torch.Generator generator, Tensor out = None, torch.dtype dtype = None, torch.layout layout = None, torch.device device = None, bool pin_memory = False, bool requires_grad = False) * (int low, int high, tuple of ints size, *, Tensor out = None, torch.dtype dtype = None, torch.layout layout = None, torch.device device = None, bool pin_memory = False, bool requires_grad = False)
So, the error message should be something direct like below:
TypeError: padding should be an integer or tuple or list of integers, but got 10.8
import torchvision torchvision.__version__ # '0.20.1'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
🐛 Describe the bug
Setting a list of
float
type values topadding
argument of RandomCrop() gets the indirect error message as shown below:So, the error message should be something direct like below:
Versions
The text was updated successfully, but these errors were encountered: