From d4cdf22947c69a0d43c0fab7c94167c7ffaa4620 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Mon, 18 Oct 2021 08:37:28 +0200 Subject: [PATCH] fix target_type selection for Caltech101 --- torchvision/datasets/caltech.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchvision/datasets/caltech.py b/torchvision/datasets/caltech.py index f3596ed0dc0..e5ddc35221c 100644 --- a/torchvision/datasets/caltech.py +++ b/torchvision/datasets/caltech.py @@ -44,7 +44,7 @@ def __init__( os.path.join(root, "caltech101"), transform=transform, target_transform=target_transform ) os.makedirs(self.root, exist_ok=True) - if not isinstance(target_type, list): + if isinstance(target_type, str): target_type = [target_type] self.target_type = [verify_str_arg(t, "target_type", ("category", "annotation")) for t in target_type]