Skip to content

Commit 91b3ef2

Browse files
pmeierfmassa
andauthored
fix VOC datasets for 2007 (#3572) (#3580)
Co-authored-by: Francisco Massa <[email protected]> Co-authored-by: Francisco Massa <[email protected]>
1 parent 19a75b5 commit 91b3ef2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

torchvision/datasets/voc.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@ def __init__(
8787
valid_image_sets = ["train", "trainval", "val"]
8888
if year == "2007":
8989
valid_image_sets.append("test")
90-
key = "2007-test"
91-
else:
92-
key = year
9390
self.image_set = verify_str_arg(image_set, "image_set", valid_image_sets)
91+
92+
key = "2007-test" if year == "2007" and image_set == "test" else year
9493
dataset_year_dict = DATASET_YEAR_DICT[key]
9594

9695
self.url = dataset_year_dict["url"]

0 commit comments

Comments
 (0)