Invalid CUDA 'device=0' requested. Use 'device=cpu' or pass valid CUDA device(s) if available, i.e. 'device=0' or 'device=0,1,2,3' for Multi-GPU.
使用Yolo检测图像时指定了device=0报错:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Ultralytics YOLOv8.1.34 🚀 Python-3.9.19 torch-2.0.1+cpu Traceback (most recent call last): File "E:\python-project\yolov10\test.py", line 6, in <module> result = model.track(source=source, show=True, device=0) File "E:\python-project\yolov10\ultralytics\engine\model.py", line 481, in track return self.predict(source=source, stream=stream, **kwargs) File "E:\python-project\yolov10\ultralytics\engine\model.py", line 434, in predict self.predictor.setup_model(model=self.model, verbose=is_cli) File "E:\python-project\yolov10\ultralytics\engine\predictor.py", line 299, in setup_model device=select_device(self.args.device, verbose=verbose), File "E:\python-project\yolov10\ultralytics\utils\torch_utils.py", line 128, in select_device raise ValueError( ValueError: Invalid CUDA 'device=0' requested. Use 'device=cpu' or pass valid CUDA device(s) if available, i.e. 'device=0' or 'device=0,1,2,3' for Multi-GPU.
torch.cuda.is_available(): False torch.cuda.device_count(): 0 os.environ['CUDA_VISIBLE_DEVICES']: None See https://pytorch.org/get-started/locally/ for up-to-date torch install instructions if no CUDA devices are seen by torch.