Skip to content

Commit

Permalink
Update cache check (ultralytics#3691)
Browse files Browse the repository at this point in the history
Swapped order of operations for faster first per ultralytics@19b88b2#r52362419
  • Loading branch information
glenn-jocher committed Jun 19, 2021
1 parent f4aef3e commit 7fa7d66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def __init__(self, path, img_size=640, batch_size=16, augment=False, hyp=None, r
cache_path = (p if p.is_file() else Path(self.label_files[0]).parent).with_suffix('.cache') # cached labels
if cache_path.is_file():
cache, exists = torch.load(cache_path), True # load
if cache['hash'] != get_hash(self.label_files + self.img_files) or cache['version'] != 0.3:
if cache['version'] != 0.3 or cache['hash'] != get_hash(self.label_files + self.img_files):
cache, exists = self.cache_labels(cache_path, prefix), False # re-cache
else:
cache, exists = self.cache_labels(cache_path, prefix), False # cache
Expand Down

0 comments on commit 7fa7d66

Please sign in to comment.