-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Setting float and bool values to quality argument of JPEG() gets the indirect errors #8917
Copy link
Copy link
Closed
Description
🐛 Describe the bug
Setting float and bool values to quality argument of JPEG() gets the indirect errors as shown below:
from torchvision.transforms.v2 import JPEG
JPEG(quality=5.3) # ErrorTypeError: quality should be a sequence of length 2.
from torchvision.datasets import OxfordIIITPet
from torchvision.transforms.v2 import JPEG
my_data = OxfordIIITPet(
root="data",
transform=JPEG(quality=True)
)
my_data[0] # ErrorTypeError: randint() received an invalid combination of arguments - got (bool, int, 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 they should be something direct like below:
TypeError:
qualityargument must be int
Versions
import torchvision
torchvision.__version__ # '0.20.1'Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels