Unverified 提交 e309a855 authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Add val.py no label warning (#8782)

Help resolve confusion around zero-metrics val.py results when no labels are found in https://github.com/ultralytics/yolov5/issues/8753
上级 567397d6
......@@ -275,6 +275,8 @@ def run(
# Print results
pf = '%20s' + '%11i' * 2 + '%11.3g' * 4 # print format
LOGGER.info(pf % ('all', seen, nt.sum(), mp, mr, map50, map))
if nt.sum() == 0:
LOGGER.warning(emojis(f'WARNING: no labels found in {task} set, can not compute metrics without labels ⚠️'))
# Print results per class
if (verbose or (nc < 50 and not training)) and nc > 1 and len(stats):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论