报错提示
Traceback (most recent call last):
File “train_yolox.py”, line 565, in
box_ap = eval(_decode, val_images, cfg.val_pre_path, cfg.val_path, cfg.eval_cfg[‘eval_batch_size’], _clsid2catid, cfg.eval_cfg[‘draw_image’], cfg.eval_cfg[‘draw_thresh’])
File “/home/aistudio/work/tools/cocotools_yolo.py”, line 184, in eval
box_ap_stats = bbox_eval(anno_file)
File “/home/aistudio/work/tools/cocotools.py”, line 99, in bbox_eval
map_stats = cocoapi_eval(outfile, ‘bbox’, coco_gt=coco_gt)
File “/home/aistudio/work/tools/cocotools.py”, line 69, in cocoapi_eval
coco_dt = coco_gt.loadRes(jsonfile)
File “/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/pycocotools/coco.py”, line 329, in loadRes
if ‘caption’ in anns[0]:
IndexError: list index out of range
原因
逐行代码排查了,发现是因为没有成功预测到结果,导致bbox_data为空,写入的JSON文件也为空,所以loadRes出现问题。应该是训练不充分导致的错误…
解决方案
试过修改co