"vscode:/vscode.git/clone" did not exist on "a33ce08b64eebc3210dd8544e3d84e1dc495dc6b"
Unverified Commit 47e59b16 authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

separate caching logic from download (#3448)


Co-authored-by: default avatarFrancisco Massa <fvsmassa@gmail.com>
parent b266c2f1
......@@ -92,8 +92,10 @@ class PhotoTour(VisionDataset):
self.download()
if not self._check_datafile_exists():
raise RuntimeError('Dataset not found.' +
' You can use download=True to download it')
try:
self.cache()
except Exception as error:
raise RuntimeError("Dataset not found. You can use download=True to download it") from error
# load the serialized data
self.data, self.labels, self.matches = torch.load(self.data_file)
......@@ -151,6 +153,7 @@ class PhotoTour(VisionDataset):
os.unlink(fpath)
def cache(self) -> None:
# process and save as torch files
print('# Caching data {}'.format(self.data_file))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment