From 7fa7d66413ee17abc04e33ac99506bd39a950d8b Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 19 Jun 2021 11:22:09 +0200 Subject: [PATCH] Update cache check (#3691) Swapped order of operations for faster first per https://github.com/ultralytics/yolov5/commit/19b88b2adf96ccfa5ddc1450ab0ab4319d1df716#r52362419 --- utils/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/datasets.py b/utils/datasets.py index f927abb20f5a..8fce61bb08a2 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -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