PyTorch: RuntimeError: device >= 0 && device < num_gpus INTERNAL ASSERT FAILED · Issue #126344 · pytorch/pytorch

When I'm trying to use PyTorch with YOLO with yolo detect ... device=0, I'm getting this error: RuntimeError: device >= 0 && device < num_gpus INTERNAL ASSERT FAILED at "../aten/src/ATen/cuda/CUDAC...