From 1fe342040a12dd21e43500d5e12e66f376a37fe1 Mon Sep 17 00:00:00 2001 From: Iacopo Poli Date: Wed, 28 Feb 2018 14:55:45 +0000 Subject: [PATCH] Fix bug in LSUN dataset for test split. Both conditional branches in `__init__` were executed, since `classes` for test becomes a list and `if` was used instead of `elif`. --- torchvision/datasets/lsun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchvision/datasets/lsun.py b/torchvision/datasets/lsun.py index e165b957c67..1612e03063c 100644 --- a/torchvision/datasets/lsun.py +++ b/torchvision/datasets/lsun.py @@ -81,7 +81,7 @@ def __init__(self, db_path, classes='train', classes = [classes] else: classes = [c + '_' + classes for c in categories] - if type(classes) == list: + elif type(classes) == list: for c in classes: c_short = c.split('_') c_short.pop(len(c_short) - 1)