-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Closed
Description
🐛 Describe the bug
Setting "hello" instead of "train", "valid", "test" or "all" to split argument of CelebA() gets the direct error message as shown below:
from torchvision.datasets import CelebA
my_data = CelebA(
root="data",
split="hallo" # Here
) # ErrorValueError: Unknown value 'hallo' for argument split. Valid values are {'train', 'valid', 'test', 'all'}.
But setting 3.14 or ["train"] to split argument of CelebA() gets the indirect error message as shown below:
from torchvision.datasets import CelebA
my_data = CelebA(
root="data",
split=3.14
) # ErrorAttributeError: 'float' object has no attribute 'lower'
from torchvision.datasets import CelebA
my_data = CelebA(
root="data",
split=["train"] # Here
) # ErrorAttributeError: 'list' object has no attribute 'lower'
So, they should return the direct error messages as shown below:
ValueError: Unknown value 3.14 for argument split. Valid values are {'train', 'valid', 'test', 'all'}.
ValueError: Unknown value ["train"] for argument split. Valid values are {'train', 'valid', 'test', 'all'}.
Versions
import torchvision
torchvision.__version__ # '0.20.1'Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels