glenn-jocher commited on
Commit
9ac7d38
·
unverified ·
1 Parent(s): 0e2d0d5

Backwards compatible cache version checks (#3730)

Browse files
Files changed (1) hide show
  1. utils/datasets.py +1 -1
utils/datasets.py CHANGED
@@ -390,7 +390,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
390
  cache_path = (p if p.is_file() else Path(self.label_files[0]).parent).with_suffix('.cache') # cached labels
391
  if cache_path.is_file():
392
  cache, exists = torch.load(cache_path), True # load
393
- if cache['version'] != 0.3 or cache['hash'] != get_hash(self.label_files + self.img_files):
394
  cache, exists = self.cache_labels(cache_path, prefix), False # re-cache
395
  else:
396
  cache, exists = self.cache_labels(cache_path, prefix), False # cache
 
390
  cache_path = (p if p.is_file() else Path(self.label_files[0]).parent).with_suffix('.cache') # cached labels
391
  if cache_path.is_file():
392
  cache, exists = torch.load(cache_path), True # load
393
+ if cache.get('version') != 0.3 or cache.get('hash') != get_hash(self.label_files + self.img_files):
394
  cache, exists = self.cache_labels(cache_path, prefix), False # re-cache
395
  else:
396
  cache, exists = self.cache_labels(cache_path, prefix), False # cache