glenn-jocher commited on
Commit
813eba8
·
unverified ·
1 Parent(s): b804b36

Empty val batch CUDA device fix (#7539)

Browse files

Verified fix for https://github.com/ultralytics/yolov5/pull/7525#issuecomment-1106081123

Files changed (1) hide show
  1. val.py +1 -1
val.py CHANGED
@@ -227,7 +227,7 @@ def run(
227
 
228
  if npr == 0:
229
  if nl:
230
- stats.append((correct, *torch.zeros((3, 0))))
231
  continue
232
 
233
  # Predictions
 
227
 
228
  if npr == 0:
229
  if nl:
230
+ stats.append((correct, *torch.zeros((3, 0), device=device)))
231
  continue
232
 
233
  # Predictions