Skip to content

你好,验证的时候 ins_anno_ids这个变量没有值,导致后续计算失败 #6

@lunchben

Description

@lunchben

train.py第299行
ins_anno_ids = val_dataset.getAnnIds(imgIds=img_id, iscrowd=False)

2021-03-03 19:18:34,074-INFO: Total iter: 0
2021-03-03 19:18:34,074-INFO: Test Done.
2021-03-03 19:18:34,074-INFO: total time: 0.000306s
Traceback (most recent call last):
File "train.py", line 487, 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/cqnu/文档/pmj/yolo4/Pytorch-PPYOLO/tools/cocotools.py", line 257, in eval
logger.info('Speed: %.6fs per image, %.1f FPS.'%((cost / n), (n / cost)))
ZeroDivisionError: float division by zero

跑到验证的iter的时候我的n不知道为什么是0
n 是cocotools.py 中eval()方法的image参数的length,因为从上述train的299行那里的变量就没值了,所以到这里n直接是0,就导致了下面的错误,请问可能是什么问题呢。我的数据集只有一个种类 。
望指教,谢谢。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions