"git@developer.sourcefind.cn:OpenDAS/torch-scatter.git" did not exist on "a49ba37d4b1e6e39a3e8e2b3aa95c5dbc67a8be6"
Commit 424299cc authored by Tzu-Chan (Alice) Chuang's avatar Tzu-Chan (Alice) Chuang Committed by Kai Chen
Browse files

Add exceptions handling while validating (#975)

* Add exceptions handling while validating

* fix lint

* add Exception type
parent ca7b5216
...@@ -145,7 +145,11 @@ class CocoDistEvalmAPHook(DistEvalHook): ...@@ -145,7 +145,11 @@ class CocoDistEvalmAPHook(DistEvalHook):
cocoGt = self.dataset.coco cocoGt = self.dataset.coco
imgIds = cocoGt.getImgIds() imgIds = cocoGt.getImgIds()
for res_type in res_types: for res_type in res_types:
cocoDt = cocoGt.loadRes(result_files[res_type]) try:
cocoDt = cocoGt.loadRes(result_files[res_type])
except IndexError:
print('No prediction found.')
break
iou_type = res_type iou_type = res_type
cocoEval = COCOeval(cocoGt, cocoDt, iou_type) cocoEval = COCOeval(cocoGt, cocoDt, iou_type)
cocoEval.params.imgIds = imgIds cocoEval.params.imgIds = imgIds
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment