diff --git a/utils/datasets.py b/utils/datasets.py index aeaf3722e..1cd03baff 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -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 + [cache_path]): # dataset changed + if cache['hash'] != get_hash(self.label_files + self.img_files) or 'results' not in cache: # changed cache = self.cache_labels(cache_path) # re-cache else: cache = self.cache_labels(cache_path) # cache