调试
This commit is contained in:
parent
735c7c514d
commit
a78ef10b8a
@ -428,11 +428,13 @@ class LoadImagesAndLabels(Dataset):
|
|||||||
|
|
||||||
# Check cache
|
# Check cache
|
||||||
self.label_files = img2label_paths(self.im_files) # labels
|
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')
|
cache_path = (p if p.is_file() else Path(self.label_files[0]).parent).with_suffix('.cache')
|
||||||
try:
|
try:
|
||||||
cache, exists = np.load(cache_path, allow_pickle=True).item(), True # load dict
|
cache, exists = np.load(cache_path, allow_pickle=True).item(), True # load dict
|
||||||
assert cache['version'] == self.cache_version # matches current version
|
assert cache['version'] == self.cache_version # matches current version
|
||||||
assert cache['hash'] == get_hash(self.label_files + self.im_files) # identical hash
|
assert cache['hash'] == get_hash(self.label_files + self.im_files) # identical hash
|
||||||
|
print('load_cache#########')
|
||||||
except Exception:
|
except Exception:
|
||||||
cache, exists = self.cache_labels(cache_path, prefix), False # run cache ops
|
cache, exists = self.cache_labels(cache_path, prefix), False # run cache ops
|
||||||
|
|
||||||
@ -447,6 +449,7 @@ class LoadImagesAndLabels(Dataset):
|
|||||||
|
|
||||||
# Read cache
|
# Read cache
|
||||||
[cache.pop(k) for k in ('hash', 'version', 'msgs')] # remove items
|
[cache.pop(k) for k in ('hash', 'version', 'msgs')] # remove items
|
||||||
|
print('@@@@@@@@@@@@@@@@@@@@@')
|
||||||
labels, shapes, self.segments = zip(*cache.values())
|
labels, shapes, self.segments = zip(*cache.values())
|
||||||
nl = len(np.concatenate(labels, 0)) # number of labels
|
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}'
|
assert nl > 0 or not augment, f'{prefix}All labels empty in {cache_path}, can not start training. {HELP_URL}'
|
||||||
|
Loading…
Reference in New Issue
Block a user