mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
Places365 doesn't exist in some still used torchvision version
This commit is contained in:
parent
9b2daf2a35
commit
78b36bf46c
@ -1,7 +1,11 @@
|
||||
import os
|
||||
|
||||
from torchvision.datasets import CIFAR100, CIFAR10, MNIST, QMNIST, KMNIST, FashionMNIST,\
|
||||
Places365, ImageNet, ImageFolder
|
||||
from torchvision.datasets import CIFAR100, CIFAR10, MNIST, QMNIST, KMNIST, FashionMNIST, ImageNet, ImageFolder
|
||||
try:
|
||||
from torchvision.datasets import Places365
|
||||
has_places365 = True
|
||||
except ImportError:
|
||||
has_places365 = False
|
||||
try:
|
||||
from torchvision.datasets import INaturalist
|
||||
has_inaturalist = True
|
||||
@ -104,6 +108,7 @@ def create_dataset(
|
||||
split = '2021_valid'
|
||||
ds = INaturalist(version=split, target_type=target_type, **torch_kwargs)
|
||||
elif name == 'places365':
|
||||
assert has_places365, 'Please update to a newer PyTorch and torchvision for Places365 dataset.'
|
||||
if split in _TRAIN_SYNONYM:
|
||||
split = 'train-standard'
|
||||
elif split in _EVAL_SYNONYM:
|
||||
|
Loading…
x
Reference in New Issue
Block a user