当前位置:网站首页>mmdetection ValueError: need at least one array to concatenate解决方案
mmdetection ValueError: need at least one array to concatenate解决方案
2022-06-27 01:58:00 【万里鹏程转瞬至】
在mmdetection中有时候训练模型会出现ValueError: need at least one array to concatenate的错误,详情如下图所示。

很多人都说是mmdet/dataset下coco.py或voc.py中CLASSES设置与数据集对应不上,博主不以为然。因为在mmdetection2中,不需要到mmdet/dataset中修改CLASSES,只需要在训练配置文件中中设置一下就行了。config解释器会通过继承自动修改CLASSES的值,具体可见下图,或参考mmdetection2的使用教程从数据处理、配置文件到训练与测试(支持coco数据和pascal_voc数据)_万里鹏程转瞬至的博客-CSDN博客_mmdetection2
https://hpg123.blog.csdn.net/article/details/124617894

只要配置文件中classes设置正确了,voc数据就不会出现上述的报错。
但是,coco数据集会因此数据转化时设置有误,而导致出现上述错误。博主的数据集只有shoot一个类别,在数据集转换时,通过下列方式在tools\dataset_converters\pascal_voc.py文件设置类别。【错误方式】
然后生成的coco数据存在问题,本来只有一个shoot类别的coco数据,结果出现了 20余个supercategory项目。这就是导致报错的根源。

在转换数据集时,需要通过在tools\dataset_converters\pascal_voc.py文件按照以下标准以下设置修改自定义类别
通过该方式生成的coco数据集才是严格正确的,其categories的格式如下图所示。如果是通过第三方项目生成的coco数据,则请检查categories内的数据与数据集的类别是否正常。
在修改coco数据集的错误后,现在mmdetection可以正常训练数据了。

边栏推荐
- memcached基础14
- Oracle/PLSQL: Length Function
- Memcached basics 11
- Cookie, sessionstorage, localstorage differences
- Press key to control LED status reversal
- Why divide the training set and the test set before normalization?
- WiFi-IoT 鸿蒙开发套件样例开发
- I earned 3W yuan a month from my sideline: the industry you despise really makes money!
- numpy 数组运算机制浅探
- Oracle/PLSQL: Replace Function
猜你喜欢

C language -- Design of employee information management system

使用命令行安装达梦数据库

执念斩长河暑期规划

Svg drag dress Kitty Cat

SQLite Reader 插件测试SQLite语法

按键控制LED状态翻转

速看!2022年6月编程语言排行榜出炉!第一名太牛啦

The listing of Fuyuan pharmaceutical is imminent: the net amount raised will reach 1.6 billion yuan, and hubaifan is the actual controller

Summary of config mechanism and methods in UVM (2)

I encountered some problems when connecting to the database. How can I solve them?
随机推荐
memcached基础10
Recursion will make strtok more attractive
速看!2022年6月编程语言排行榜出炉!第一名太牛啦
idea 插件开发一些异常处理
Did your case really pass?
谷歌开始卷自己,AI架构Pathways加持,推出200亿生成模型
dat. gui. JS star circle track animation JS special effect
Oracle/PLSQL: Cast Function
D's appendto packaging
Shell script series (1) getting started
SystemVerilog simulation speed increase
memcached基礎12
memcached基础9
Oracle/PLSQL: From_ Tz function
我靠副业一个月挣了3W块:你看不起的行业,真的很挣钱!
Reading a book in idea is too much!
XSS attack (note)
Memcached foundations 12
C语言--职工信息管理系统设计
h5液体动画js特效代码