Skip to content

Commit 53ad2c9

Browse files
zhiqwangpmeier
andauthored
check if the image folder exists
Co-authored-by: Philip Meier <[email protected]>
1 parent 4b21a2f commit 53ad2c9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

torchvision/datasets/flowers102.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ def extra_repr(self) -> str:
9292
return f"split={self._split}"
9393

9494
def _check_integrity(self):
95+
if not (self._images_folder.exists() and self._images_folder.isdir()):
96+
return False
97+
9598
for id in ["label", "setid"]:
9699
filename, md5 = self._file_dict[id]
97100
if not check_integrity(str(self._base_folder / filename), md5):

0 commit comments

Comments
 (0)