Update caching (#1496)

This commit is contained in:
Glenn Jocher committed 2020-11-24 16:22:02 +01:00
1 parent 89c7a5b8dc
commit 0822cda781
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -365,7 +365,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
cache_path = Path(self.label_files[0]).parent.with_suffix('.cache') # cached labels
if cache_path.is_file():
cache = torch.load(cache_path) # load
if cache['hash'] != get_hash(self.label_files + self.img_files): # dataset changed
if cache['hash'] != get_hash(self.label_files + self.img_files + [cache_path]): # dataset changed
cache = self.cache_labels(cache_path) # re-cache
else:
cache = self.cache_labels(cache_path) # cache