当前位置:   article > 正文

MMDetection实验记录踩坑记录_mmdetection训练自己数据集的ap值为0

mmdetection训练自己数据集的ap值为0

AP值始终为0

在实验MMDetection的DAB-DETR模型进行实验时,AP值始终上不去。
可以看到,在第22个epoch时的AP值仅为0.002

在这里插入图片描述

因为在此之前已经运行过YOLOX,Faster-RCNN等模型,所以数据集的设置肯定是没有问题的,而博主也只是修改了DAB-DETR的类别参数而已,一想到这,才猛然想起,DETR类模型的类别数还需要加上一类,即背景类,先前在修改参数时,看到原始参数为80,还以为不用加1了呢。
讲num_class参数数值加一,OK。再次运行:

就是可惜博主白白运行了一个晚上。

断点训练问题

MMDetection针对模型在训练过程中意外中断,避免重头训练,设计了断点训练参数 resume,只需要将该参数设置为最后一次训练的权重即可。

parser.add_argument(
        '--resume',
        nargs='?',
        default="/home/ubuntu/programs/mmdetection/output/deformable-detr/epoch_2.pth",
        type=str,
        const='auto',
        help='If specify checkpoint path, resume from it, while if not '
        'specify, try to auto resume from the latest checkpoint '
        'in the work directory.')
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

SSD模型类别信息报错

报错信息:

AssertionError: `classes` in RepeatDatasetshould be a tuple of str.Add comma if number of classes is 1 as classes = (pedestrains,)
  • 1

类别必须是元组类型,由于博主的这个数据集中只有一个类别,因此就只写了(‘pedestrains’),在后面加个逗号即可。

解决方法:

 METAINFO = {
        'classes':
        ('pedestrains',),
        # palette is a list of color tuples, which is used for visualization.
        'palette':
        [(220, 20, 60)]
    }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/337837
推荐阅读
相关标签
  

闽ICP备14008679号