From 5a40c6a3c48672cf11a1995f9ebdb54f44903f09 Mon Sep 17 00:00:00 2001 From: Edoardo Debenedetti Date: Wed, 17 Aug 2022 15:10:41 +0200 Subject: [PATCH] Fix issue with torchvision's ImageNet --- timm/data/dataset_factory.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/timm/data/dataset_factory.py b/timm/data/dataset_factory.py index 647357a9..c4738ae9 100644 --- a/timm/data/dataset_factory.py +++ b/timm/data/dataset_factory.py @@ -122,12 +122,14 @@ def create_dataset( elif name == 'imagenet': if split in _EVAL_SYNONYM: split = 'val' + torch_kwargs.pop("download") ds = ImageNet(split=split, **torch_kwargs) elif name == 'image_folder' or name == 'folder': # in case torchvision ImageFolder is preferred over timm ImageDataset for some reason if search_split and os.path.isdir(root): # look for split specific sub-folder in root root = _search_split(root, split) + torch_kwargs.pop("download") ds = ImageFolder(root, **kwargs) else: assert False, f"Unknown torchvision dataset {name}"