Skip to content

Commit f2cb28e

Browse files
glenn-jocherClay Januhowski
authored andcommitted
Empty val batch CUDA device fix (ultralytics#7539)
Verified fix for ultralytics#7525 (comment)
1 parent 78b15d4 commit f2cb28e

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
@@ -227,7 +227,7 @@ def run(
227227

228228
if npr == 0:
229229
if nl:
230-
stats.append((correct, *torch.zeros((3, 0))))
230+
stats.append((correct, *torch.zeros((3, 0), device=device)))
231231
continue
232232

233233
# Predictions

0 commit comments

Comments
 (0)