diff --git a/utils/datasets.py b/utils/datasets.py index 9b823eb..7a8f073 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -372,7 +372,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing # Check cache self.label_files = img2label_paths(self.img_files) # labels - cache_path = Path(self.label_files[0]).parent.with_suffix('.cache') # cached labels + 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 = torch.load(cache_path) # load if cache['hash'] != get_hash(self.label_files + self.img_files) or 'results' not in cache: # changed