Skip to content

Commit fad57c2

Browse files
authored
Fix is_coco on missing data['val'] key (#4642)
1 parent 234e8ae commit fad57c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

val.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def run(data,
134134

135135
# Configure
136136
model.eval()
137-
is_coco = type(data['val']) is str and data['val'].endswith('coco/val2017.txt') # COCO dataset
137+
is_coco = isinstance(data.get('val'), str) and data['val'].endswith('coco/val2017.txt') # COCO dataset
138138
nc = 1 if single_cls else int(data['nc']) # number of classes
139139
iouv = torch.linspace(0.5, 0.95, 10).to(device) # iou vector for [email protected]:0.95
140140
niou = iouv.numel()

0 commit comments

Comments
 (0)