YOLO 的!报错不知道什么情况!

问题遇到的现象和发生背景
用代码块功能插入代码,请勿粘贴截图

1 raise RuntimeError('Attempting to deserialize object on a CUDA '
'device but torch.cuda.is_available() is False. '
'If you are running on a CPU-only machine, '
'please use torch.load with map_location=torch.device('cpu') '
'to map your storages to the CPU.')
2 device = validate_cuda_device(location)
if getattr(obj, "_torch_load_uninitialized", False):
with torch.cuda.device(device):
return torch.UntypedStorage(obj.nbytes(), device=torch.device(location))
else:
return obj.cuda(device)
3 result = fn(storage, location)
if result is not None:
return result
4 return default_restore_location(storage, str(map_location))

5
wrap_storage=restore_location(storage, location),
dtype=dtype)

6 load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location))

运行结果及报错内容

RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

https://blog.csdn.net/leiwuhen92/article/details/126419345中的3.3章节
原因是默认开启GPU加速,而你的CUDA不可用