Skip to content

Commit

Permalink
Fix is_coco on missing data['val'] key (ultralytics#4642)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Sep 1, 2021
1 parent d1592db commit 06521cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion val.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def run(data,

# Configure
model.eval()
is_coco = type(data['val']) is str and data['val'].endswith('coco/val2017.txt') # COCO dataset
is_coco = isinstance(data.get('val'), str) and data['val'].endswith('coco/val2017.txt') # COCO dataset
nc = 1 if single_cls else int(data['nc']) # number of classes
iouv = torch.linspace(0.5, 0.95, 10).to(device) # iou vector for mAP@0.5:0.95
niou = iouv.numel()
Expand Down

0 comments on commit 06521cf

Please sign in to comment.