YOLOv5报错AssertionError:Label class 1 exceeds nc=1 in yolo/dataset.ymal Possible class labels are 0-0

这篇具有很好参考价值的文章主要介绍了YOLOv5报错AssertionError:Label class 1 exceeds nc=1 in yolo/dataset.ymal Possible class labels are 0-0。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

新手小白最近在学习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}'

即可成功运行。

YOLOv5报错AssertionError:Label class 1 exceeds nc=1 in yolo/dataset.ymal Possible class labels are 0-0,YOLO,深度学习,人工智能

参考来源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模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • YOLOv5训练数据提示No labels found、with_suffix使用、yolov5训练时出现WARNING: Ignoring corrupted image and/or label

    仔细看下数据加载、处理的文件datasets.py,发现有一句会根据第2步中images文件夹的位置找到对应labels文件夹: YOLOv5加载标签的地方在 datasets.py 中的这个地方,我们修改一下加载label的路径为自己的label放置位置就好。 在这个 img2label_paths 函数中,我们的修改如下:【因为我们

    2024年02月04日
    浏览(34)
  • vivado报错 Validation Failed:User configuration exceeds BRAM count in the selected device!

    最近课设,使用vivado调用一个rom的IP,但是报错如上,从网上查阅说是FPGA的资源不够,但是我的资源量肯定是足够的,为此,不得其解,经猜测试验,最终问题是由于给的深度(下图中的Port A Depth)大于存储的数据量太多;将深度减少部分即可;  

    2024年02月14日
    浏览(32)
  • yolov5 报错解决记录

     Failed to initialize: Bad git executable. The git executable must be specified in one of the following ways:     - be included in your $PATH     - be set via $GIT_PYTHON_GIT_EXECUTABLE     - explicitly set via git.refresh() All git commands will error until this is rectified. This initial warning can be silenced or aggravated in the future by setting

    2024年02月03日
    浏览(31)
  • YOLOv5初级问题与报错汇总

    本人应学校需求掌握机器视觉相关工具,于是零基础跟着大佬的步伐一步一步走。目标检测---教你利用yolov5训练自己的目标检测模型 由于版本更迭等等原因,会遇到很多原作者没有的问题。这里跟随原作者的配置yolov5脚步,将原作者没有遇到的问题进行一个汇总。 这还是p

    2024年02月03日
    浏览(30)
  • 解决YOLOv5训练自己的数据集出现No labels in path\train.cache问题

    不知道是第几次训练了,最开始跑也出现了这个问题,当时怎么解决的时隔了几个月又完全忘了,还好翻看了几个博客后回忆了起来 我自己的数据集的格式是VOC格式,如下图  若没有对数据集进行划分,则使用makeTXT.py对数据集进行划分,若数据集已经划分,则可忽略这一步

    2024年02月12日
    浏览(41)
  • 报错 Error creating bean with name ‘elasticsearchTemplate‘ defined in class path resource

    报错信息如下: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name \\\'indexController\\\': Unsatisfied dependency expressed through field \\\'articleService\\\'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name \\\'articleServiceImpl\\\': Unsatisfied dependen

    2023年04月08日
    浏览(33)
  • 【YOLOv5】一些不常见的报错及解决【持续更新】

    目录 AssertionError: Label class 4 exceeds nc=4 in /xxxxxx解决方法 原因 解决方法:(以我的情况为例) RuntimeError: result type Float can‘t be cast to the desired output type long int 原因 解决方法 ImportError: libgthread-2.0.so.0: cannot open shared object file: tensorboard :No dashboards are active for the current data set. 问题

    2024年02月12日
    浏览(26)
  • 【YOLOv5】一些网上找不到答案的报错解决方案

    目录 AssertionError: Label class 4 exceeds nc=4 in /xxxxxx解决方法 原因 解决方法:(以我的情况为例) RuntimeError: result type Float can‘t be cast to the desired output type long int 原因 解决方法 ImportError: libgthread-2.0.so.0: cannot open shared object file: tensorboard :No dashboards are active for the current data set. 问题

    2024年02月12日
    浏览(32)
  • YOLOv5-7.0解决报错ImportError: Bad git executable.

    最近在复习yolov5目标检测代码时用了yolov5的最新7.0版本,之前用的是5.0版本,这一新版本相对于之前做了一些提升,对于package的兼容也要好了很多,但也不是说下载了直接就能运行,实际使用过程中还是遇到了许多新的问题,下面就我自己碰到的问题提出解决方法。 ImportE

    2024年03月16日
    浏览(81)
  • cMake编译yolov5报错:【CUDA】No CUDA toolset found.

    问题:cMake编译yolov5报错:No CUDA toolset found. 解决:在stackoverflow找到解决方案。 将该路径下的四个文件 C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.1extrasvisual_studio_integrationMSBuildExtensions 拷贝到以下路径中。 C:Program Files (x86)Microsoft Visual Studio2019EnterpriseMSBuildMicrosoftVCv160

    2024年02月15日
    浏览(39)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包