Skip to content

Commit ed4710b

Browse files
authored
Put back StanfordCars.download (the function, NOT the feature) (#8324)
1 parent 4028d9f commit ed4710b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

torchvision/datasets/stanford_cars.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,7 @@ def __init__(
6161
self._images_base_path = self._base_folder / "cars_test"
6262

6363
if download:
64-
raise ValueError(
65-
"The original URL is broken so the StanfordCars dataset is not available for automatic "
66-
"download anymore. You can try to download it manually following "
67-
"https://github.com/pytorch/vision/issues/7545#issuecomment-1631441616, "
68-
"and set download=False to avoid this error."
69-
)
64+
self.download()
7065

7166
if not self._check_exists():
7267
raise RuntimeError(
@@ -104,3 +99,11 @@ def _check_exists(self) -> bool:
10499
return False
105100

106101
return self._annotations_mat_path.exists() and self._images_base_path.is_dir()
102+
103+
def download(self):
104+
raise ValueError(
105+
"The original URL is broken so the StanfordCars dataset is not available for automatic "
106+
"download anymore. You can try to download it manually following "
107+
"https://github.com/pytorch/vision/issues/7545#issuecomment-1631441616, "
108+
"and set download=False to avoid this error."
109+
)

0 commit comments

Comments
 (0)