Skip to content

Commit

Permalink
Don't print when dataset is already downloaded (#8681)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug authored Oct 14, 2024
1 parent a7f0d25 commit f68bac9
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 14 deletions.
2 changes: 0 additions & 2 deletions torchvision/datasets/caltech.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def __len__(self) -> int:

def download(self) -> None:
if self._check_integrity():
print("Files already downloaded and verified")
return

download_and_extract_archive(
Expand Down Expand Up @@ -231,7 +230,6 @@ def __len__(self) -> int:

def download(self) -> None:
if self._check_integrity():
print("Files already downloaded and verified")
return

download_and_extract_archive(
Expand Down
1 change: 0 additions & 1 deletion torchvision/datasets/celeba.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ def _check_integrity(self) -> bool:

def download(self) -> None:
if self._check_integrity():
print("Files already downloaded and verified")
return

for (file_id, md5, filename) in self.file_list:
Expand Down
1 change: 0 additions & 1 deletion torchvision/datasets/cifar.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ def _check_integrity(self) -> bool:

def download(self) -> None:
if self._check_integrity():
print("Files already downloaded and verified")
return
download_and_extract_archive(self.url, self.root, filename=self.filename, md5=self.tgz_md5)

Expand Down
5 changes: 1 addition & 4 deletions torchvision/datasets/imagenette.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ def _check_exists(self) -> bool:

def _download(self):
if self._check_exists():
raise RuntimeError(
f"The directory {self._size_root} already exists. "
f"If you want to re-download or re-extract the images, delete the directory."
)
return

download_and_extract_archive(self._url, self.root, md5=self._md5)

Expand Down
1 change: 0 additions & 1 deletion torchvision/datasets/lfw.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def _check_integrity(self) -> bool:

def download(self) -> None:
if self._check_integrity():
print("Files already downloaded and verified")
return
url = f"{self.download_url_prefix}{self.filename}"
download_and_extract_archive(url, self.root, filename=self.filename, md5=self.md5)
Expand Down
1 change: 0 additions & 1 deletion torchvision/datasets/omniglot.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def _check_integrity(self) -> bool:

def download(self) -> None:
if self._check_integrity():
print("Files already downloaded and verified")
return

filename = self._get_target_folder()
Expand Down
1 change: 0 additions & 1 deletion torchvision/datasets/sbu.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ def download(self) -> None:
"""Download and extract the tarball, and download each individual photo."""

if self._check_integrity():
print("Files already downloaded and verified")
return

download_and_extract_archive(self.url, self.root, self.root, self.filename, self.md5_checksum)
Expand Down
1 change: 0 additions & 1 deletion torchvision/datasets/semeion.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def _check_integrity(self) -> bool:

def download(self) -> None:
if self._check_integrity():
print("Files already downloaded and verified")
return

root = self.root
Expand Down
1 change: 0 additions & 1 deletion torchvision/datasets/stl10.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ def _check_integrity(self) -> bool:

def download(self) -> None:
if self._check_integrity():
print("Files already downloaded and verified")
return
download_and_extract_archive(self.url, self.root, filename=self.filename, md5=self.tgz_md5)
self._check_integrity()
Expand Down
1 change: 0 additions & 1 deletion torchvision/datasets/widerface.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ def _check_integrity(self) -> bool:

def download(self) -> None:
if self._check_integrity():
print("Files already downloaded and verified")
return

# download and extract image data
Expand Down

0 comments on commit f68bac9

Please sign in to comment.