【BUG】mmdetection ValueError: need at least one array to concatenate

问题: 使用mmdetection框架使用COCO格式 训练自定义数据集时出现如下错误:

ValueError: need at least one array to concatenate

解决方法: 修改mmdet/datasets/coco.py文件,将CocoDataset类中的METAINFO修改为自己数据集的类别信息,具体如下:

python 复制代码
    # METAINFO = {
    #     'classes':
    #     ('person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train',
    #      'truck', 'boat', 'traffic light', 'fire hydrant', 'stop sign',
    #      'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep',
    #      'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella',
    #      'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard',
    #      'sports ball', 'kite', 'baseball bat', 'baseball glove', 'skateboard',
    #      'surfboard', 'tennis racket', 'bottle', 'wine glass', 'cup', 'fork',
    #      'knife', 'spoon', 'bowl', 'banana', 'apple', 'sandwich', 'orange',
    #      'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair',
    #      'couch', 'potted plant', 'bed', 'dining table', 'toilet', 'tv',
    #      'laptop', 'mouse', 'remote', 'keyboard', 'cell phone', 'microwave',
    #      'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock', 'vase',
    #      'scissors', 'teddy bear', 'hair drier', 'toothbrush'),
    #     # palette is a list of color tuples, which is used for visualization.
    #     'palette':
    #     [(220, 20, 60), (119, 11, 32), (0, 0, 142), (0, 0, 230), (106, 0, 228),
    #      (0, 60, 100), (0, 80, 100), (0, 0, 70), (0, 0, 192), (250, 170, 30),
    #      (100, 170, 30), (220, 220, 0), (175, 116, 175), (250, 0, 30),
    #      (165, 42, 42), (255, 77, 255), (0, 226, 252), (182, 182, 255),
    #      (0, 82, 0), (120, 166, 157), (110, 76, 0), (174, 57, 255),
    #      (199, 100, 0), (72, 0, 118), (255, 179, 240), (0, 125, 92),
    #      (209, 0, 151), (188, 208, 182), (0, 220, 176), (255, 99, 164),
    #      (92, 0, 73), (133, 129, 255), (78, 180, 255), (0, 228, 0),
    #      (174, 255, 243), (45, 89, 255), (134, 134, 103), (145, 148, 174),
    #      (255, 208, 186), (197, 226, 255), (171, 134, 1), (109, 63, 54),
    #      (207, 138, 255), (151, 0, 95), (9, 80, 61), (84, 105, 51),
    #      (74, 65, 105), (166, 196, 102), (208, 195, 210), (255, 109, 65),
    #      (0, 143, 149), (179, 0, 194), (209, 99, 106), (5, 121, 0),
    #      (227, 255, 205), (147, 186, 208), (153, 69, 1), (3, 95, 161),
    #      (163, 255, 0), (119, 0, 170), (0, 182, 199), (0, 165, 120),
    #      (183, 130, 88), (95, 32, 0), (130, 114, 135), (110, 129, 133),
    #      (166, 74, 118), (219, 142, 185), (79, 210, 114), (178, 90, 62),
    #      (65, 70, 15), (127, 167, 115), (59, 105, 106), (142, 108, 45),
    #      (196, 172, 0), (95, 54, 80), (128, 76, 255), (201, 57, 1),
    #      (246, 0, 122), (191, 162, 208)]
    # }
    METAINFO = {
        'classes':
            ('class_1', 'class_2', 'class_3', 'class_4', 'class_5'),
        # palette is a list of color tuples, which is used for visualization.
        'palette':
            [(220, 20, 60), (119, 11, 32), (0, 0, 142), (0, 0, 230), (106, 0, 228)]
    }
相关推荐
lili001218 小时前
Claude自动修Bug配置优化与避坑指南
java·人工智能·python·bug·ai编程
小陶来咯2 天前
agent × 豆包:端到端语音实时交互
网络·ai·机器人·bug·交互
鬼才血脉3 天前
Idea使用Tomact运行项目,控制台输出中文乱码
tomcat·bug
NiceCloud喜云3 天前
Anthropic 发布 Project Glasswing:未公开模型 Mythos 已挖出 10000+ 漏洞,含 OpenBSD 27 年老 bug
android·java·数据库·c++·python·docker·bug
xufengzhu4 天前
臻识摄像头黑屏Bug 处理
bug·图像识别·摄像头
李永奉4 天前
杰理SDK开发-【BUG】软件开启音量同步连接华为、荣耀手机没有自动开启音量同步
单片机·嵌入式硬件·mcu·物联网·智能手机·bug·语音识别
堕2744 天前
软件测试bug篇
bug·压力测试
java修仙传4 天前
Java 实习日记:断面分析基态限额为空问题的排查与修复
java·开发语言·bug·实习
tkokof15 天前
捉虫(Bug)再记
游戏·bug·游戏开发
会周易的程序员5 天前
AI 编程助手:从“猫弄乱的线团”到“击鼓传花”的 Bug 修复
c++·人工智能·物联网·架构·bug·iot