diff --git a/torchvision/datasets/lfw.py b/torchvision/datasets/lfw.py index 5e727df59f1..2ff17af5328 100644 --- a/torchvision/datasets/lfw.py +++ b/torchvision/datasets/lfw.py @@ -51,6 +51,10 @@ def __init__( self.data: list[Any] = [] if download: + raise ValueError( + "LFW dataset is no longer available for download." + "Please download the dataset manually and place it in the specified directory" + ) self.download() if not self._check_integrity(): @@ -90,6 +94,11 @@ def __len__(self) -> int: class LFWPeople(_LFW): """`LFW `_ Dataset. + .. warning: + + The LFW dataset is no longer available for automatic download. Please + download it manually and place it in the specified directory. + Args: root (str or ``pathlib.Path``): Root directory of dataset where directory ``lfw-py`` exists or will be saved to if download is set to True. @@ -101,9 +110,7 @@ class LFWPeople(_LFW): and returns a transformed version. E.g, ``transforms.RandomCrop`` target_transform (callable, optional): A function/transform that takes in the target and transforms it. - download (bool, optional): If true, downloads the dataset from the internet and - puts it in root directory. If dataset is already downloaded, it is not - downloaded again. + download (bool, optional): NOT SUPPORTED ANYMORE, leave to False. loader (callable, optional): A function to load an image given its path. By default, it uses PIL as its image loader, but users could also pass in ``torchvision.io.decode_image`` for decoding image data into tensors directly. @@ -175,6 +182,11 @@ def extra_repr(self) -> str: class LFWPairs(_LFW): """`LFW `_ Dataset. + .. warning: + + The LFW dataset is no longer available for automatic download. Please + download it manually and place it in the specified directory. + Args: root (str or ``pathlib.Path``): Root directory of dataset where directory ``lfw-py`` exists or will be saved to if download is set to True. @@ -186,9 +198,7 @@ class LFWPairs(_LFW): and returns a transformed version. E.g, ``transforms.RandomRotation`` target_transform (callable, optional): A function/transform that takes in the target and transforms it. - download (bool, optional): If true, downloads the dataset from the internet and - puts it in root directory. If dataset is already downloaded, it is not - downloaded again. + download (bool, optional): NOT SUPPORTED ANYMORE, leave to False. loader (callable, optional): A function to load an image given its path. By default, it uses PIL as its image loader, but users could also pass in ``torchvision.io.decode_image`` for decoding image data into tensors directly.