Created by: shuxsu
catid2name
训练过程打印发现:
index created! {1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6} {'sky': 1, 'building': 2, 'vegetation': 3, 'person': 4, 'car': 5, 'terrain': 6} 和我数据集id不相符合啊,数据集id为:
categories": [ { "supercategory": "component", "id": 1, "name": "sky" }, { "supercategory": "component", "id": 2, "name": "building" }, { "supercategory": "component", "id": 3, "name": "terrain" }, { "supercategory": "component", "id": 4, "name": "person" }, { "supercategory": "component", "id": 5, "name": "vegetation" }, { "supercategory": "component", "id": 6, "name": "car" }
Created by: shuxsu
可视化的时候可以在coco_eval.py的get_category_info中查看clsid2catid, catid2name信息 可以看下这个是不是符合预期的。在训练过程中是根据coco_loader.py中的clsid2catid, catid2name 来定义类别的,可以看下这两个是不是一致的
找到问题所在可能为: 训练集和验证集的 类别id并不一样导致,是否为x2coco.py脚本文件导致? 因为转换后数据集和验证集不再为一样的id对应类别 如上面数据集代码所示 1:sky 2:building 3:训练集为terrain 验证集为vegetation 4:person 5:训练集为car 验证集为vegetation 6:训练集为terrain 验证集为car
当使用训练集的json文件进行测试时发现 bbox类别标签正确
所以数据集转换脚本是否存在问题?
Created by: jerrywgz
这个问题应该是你是分别对训练集和测试集进行转换的,在x2coco当中label_to_num这个字典产生的顺序不一致导致的,https://github.com/PaddlePaddle/PaddleDetection/blob/release/0.1/ppdet/data/tools/x2coco.py#L171 你可以在这里手动给定一个label_to_num的字典,保证训练和测试集转换后对应的cat_id顺序是一致的 后续我们会再优化下数据生成方式