Add "assert len(labels)" catch (#4257)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
dde89c744c
commit
29ace4982d
2 changed files with 2 additions and 1 deletions
|
|
@ -126,6 +126,7 @@ class YOLODataset(BaseDataset):
|
|||
# Read cache
|
||||
[cache.pop(k) for k in ('hash', 'version', 'msgs')] # remove items
|
||||
labels = cache['labels']
|
||||
assert len(labels), f'No valid labels found, please check your dataset. {HELP_URL}'
|
||||
self.im_files = [lb['im_file'] for lb in labels] # update im_files
|
||||
|
||||
# Check if the dataset is all boxes or all segments
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue