Skip to content

Commit f68bac9

Browse files
authored
Don't print when dataset is already downloaded (#8681)
1 parent a7f0d25 commit f68bac9

File tree

10 files changed

+1
-14
lines changed

10 files changed

+1
-14
lines changed

torchvision/datasets/caltech.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ def __len__(self) -> int:
130130

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

136135
download_and_extract_archive(
@@ -231,7 +230,6 @@ def __len__(self) -> int:
231230

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

237235
download_and_extract_archive(

torchvision/datasets/celeba.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ def _check_integrity(self) -> bool:
148148

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

154153
for (file_id, md5, filename) in self.file_list:

torchvision/datasets/cifar.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ def _check_integrity(self) -> bool:
135135

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

torchvision/datasets/imagenette.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ def _check_exists(self) -> bool:
8181

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

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

torchvision/datasets/lfw.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def _check_integrity(self) -> bool:
7474

7575
def download(self) -> None:
7676
if self._check_integrity():
77-
print("Files already downloaded and verified")
7877
return
7978
url = f"{self.download_url_prefix}{self.filename}"
8079
download_and_extract_archive(url, self.root, filename=self.filename, md5=self.md5)

torchvision/datasets/omniglot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def _check_integrity(self) -> bool:
9191

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

9796
filename = self._get_target_folder()

torchvision/datasets/sbu.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def download(self) -> None:
9393
"""Download and extract the tarball, and download each individual photo."""
9494

9595
if self._check_integrity():
96-
print("Files already downloaded and verified")
9796
return
9897

9998
download_and_extract_archive(self.url, self.root, self.root, self.filename, self.md5_checksum)

torchvision/datasets/semeion.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def _check_integrity(self) -> bool:
8585

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

9190
root = self.root

torchvision/datasets/stl10.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ def _check_integrity(self) -> bool:
154154

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

torchvision/datasets/widerface.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ def _check_integrity(self) -> bool:
182182

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

188187
# download and extract image data

0 commit comments

Comments
 (0)