新手小白最近在学习yolov5进行检测,记录一下自己在环境搭建及和程序运行中所遇到的问题及解决方法。可能不是解决问题最好的一种可以给一个参考,有其他的解决方法可以麻烦指出来,谢谢。
问题一:在运行train.py(只有1类)程序过程中出现“AssertionError:Label class 1 exceeds nc=1 in yolo/dataset.ymal Possible class labels are 0-0”情况。
解决方法:找到train.py文件中这一行代码,注释掉(我的在第222行位置)。
assert mlc < nc, f'Label class {mlc} exceeds nc={nc} in {data}. Possible class labels are 0-{nc - 1}'
注释后:
#assert mlc < nc, f'Label class {mlc} exceeds nc={nc} in {data}. Possible class labels are 0-{nc - 1}'
即可成功运行。
文章来源:https://www.toymoban.com/news/detail-648955.html
参考来源https://blog.csdn.net/qq_45714906/article/details/120528631文章来源地址https://www.toymoban.com/news/detail-648955.html
到了这里,关于YOLOv5报错AssertionError:Label class 1 exceeds nc=1 in yolo/dataset.ymal Possible class labels are 0-0的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!