【mmdetection】faster-rcnn训练自定义coco数据集,出现The testing results of the whole dataset is empty解决办法!

最近在使用mmdetection的faster-rcnn训练自定义coco数据集过程中,出现了

ERROR - The testing results of the whole dataset is empty

同时,各种指标不正常,不管训练多久,loss_rpn_cls: 0.0001, loss_rpn_bbox: 0.0000, loss_cls: 0.0000, acc: 100.0000都保存不变,如下图所示:

【mmdetection】faster-rcnn训练自定义coco数据集,出现The testing results of the whole dataset is empty解决办法!_第1张图片

为什么我配置的训练集、测试集文件路径都没用问题,却无法正确的使用测试集图片进行验证呢?肯定是在读取图片过程中出现了问题。

通过在mmdetection的代码中不断打BUG调试才发现问题!

我使用的配置文件是configs\faster_rcnn\faster_rcnn_r50_fpn_1x_coco.py打开文件可以看到它加载了四个配置文件。

_base_ = [
    '../_base_/models/faster_rcnn_r50_fpn.py',
    '../_base_/datasets/coco_detection.py',
    '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]

找到configs\_base_\datasets\coco_detection.py

代码中img_scale=(1333, 800)为默认值,但由于我前段时间在训练一个模型时,将img_scale改为了img_scale=(320, 240),而我当前输入图片的尺寸是1280*720,哎!罪过!!!

将img_scale改为img_scale=(1280, 720)即可,一共两处,都要改!!!

你可能感兴趣的:(目标识别,mmdetection,python,目标检测)