Empty val batch CUDA device fix (#7539)
Browse filesVerified fix for https://github.com/ultralytics/yolov5/pull/7525#issuecomment-1106081123
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
|