From fb32919026786b06439741c6093e0942a892f322 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 5 Feb 2021 11:02:20 -0800 Subject: [PATCH] Update datasets.py --- utils/datasets.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/utils/datasets.py b/utils/datasets.py index f172de233614..7a8f073608cb 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -372,9 +372,7 @@ def __init__(self, path, img_size=640, batch_size=16, augment=False, hyp=None, r # Check cache self.label_files = img2label_paths(self.img_files) # labels - cache_basename = os.path.basename(os.path.dirname(self.label_files[0])) - new_cache = self.label_files[0].replace(cache_basename, data_type) - cache_path = Path(new_cache).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