Skip to content

Commit 7a9e8ca

Browse files
committed
Revert "Indicate Celeba download parameter is deprecated and will be removed (pytorch#6059)"
This reverts commit 49496c4.
1 parent efc67ea commit 7a9e8ca

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

torchvision/datasets/celeba.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import csv
22
import os
3-
import warnings
43
from collections import namedtuple
54
from typing import Any, Callable, List, Optional, Union, Tuple
65

@@ -36,12 +35,11 @@ class CelebA(VisionDataset):
3635
and returns a transformed version. E.g, ``transforms.PILToTensor``
3736
target_transform (callable, optional): A function/transform that takes in the
3837
target and transforms it.
39-
download (bool, optional): Deprecated.
38+
download (bool, optional): Unsupported.
4039
4140
.. warning::
4241
43-
Downloading CelebA is not supported anymore as of 0.13 and this
44-
parameter will be removed in 0.15. See
42+
Downloading CelebA is not supported anymore as of 0.13. See
4543
`this issue <https://github.com/pytorch/vision/issues/5705>`__
4644
for more details.
4745
Please download the files from
@@ -73,7 +71,7 @@ def __init__(
7371
target_type: Union[List[str], str] = "attr",
7472
transform: Optional[Callable] = None,
7573
target_transform: Optional[Callable] = None,
76-
download: bool = None,
74+
download: bool = False,
7775
) -> None:
7876
super().__init__(root, transform=transform, target_transform=target_transform)
7977
self.split = split
@@ -85,15 +83,6 @@ def __init__(
8583
if not self.target_type and self.target_transform is not None:
8684
raise RuntimeError("target_transform is specified but target_type is empty")
8785

88-
if download is not None:
89-
warnings.warn(
90-
"Downloading CelebA is not supported anymore as of 0.13, and the "
91-
"download parameter will be removed in 0.15. See "
92-
"https://github.com/pytorch/vision/issues/5705 for more details. "
93-
"Please download the files from "
94-
"https://mmlab.ie.cuhk.edu.hk/projects/CelebA.html and extract them "
95-
"in ``root/celeba``."
96-
)
9786
if download:
9887
self.download()
9988

@@ -165,8 +154,7 @@ def download(self) -> None:
165154
return
166155

167156
raise ValueError(
168-
"Downloading CelebA is not supported anymore as of 0.13, and the "
169-
"download parameter will be removed in 0.15. See "
157+
"Downloading CelebA is not supported anymore as of 0.13. See "
170158
"https://github.com/pytorch/vision/issues/5705 for more details. "
171159
"Please download the files from "
172160
"https://mmlab.ie.cuhk.edu.hk/projects/CelebA.html and extract them "

0 commit comments

Comments
 (0)