From a78ef10b8ac8d1974dbcf9ab95da057a786d9121 Mon Sep 17 00:00:00 2001 From: "552068321@qq.com" Date: Mon, 7 Nov 2022 21:07:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/yolov5/utils/dataloaders.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/yolov5/utils/dataloaders.py b/app/yolov5/utils/dataloaders.py index a6d8383..ebf717e 100644 --- a/app/yolov5/utils/dataloaders.py +++ b/app/yolov5/utils/dataloaders.py @@ -428,11 +428,13 @@ class LoadImagesAndLabels(Dataset): # Check cache self.label_files = img2label_paths(self.im_files) # labels + print('labelfile############',self.label_files) cache_path = (p if p.is_file() else Path(self.label_files[0]).parent).with_suffix('.cache') try: cache, exists = np.load(cache_path, allow_pickle=True).item(), True # load dict assert cache['version'] == self.cache_version # matches current version assert cache['hash'] == get_hash(self.label_files + self.im_files) # identical hash + print('load_cache#########') except Exception: cache, exists = self.cache_labels(cache_path, prefix), False # run cache ops @@ -447,6 +449,7 @@ class LoadImagesAndLabels(Dataset): # Read cache [cache.pop(k) for k in ('hash', 'version', 'msgs')] # remove items + print('@@@@@@@@@@@@@@@@@@@@@') labels, shapes, self.segments = zip(*cache.values()) nl = len(np.concatenate(labels, 0)) # number of labels assert nl > 0 or not augment, f'{prefix}All labels empty in {cache_path}, can not start training. {HELP_URL}'