报错如下:

zhz@user-H3C-UniServer-R4900-G5:~$ nvidia-smi
NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

(yolov5) zhz@user-H3C-UniServer-R4900-G5:~/yolov5-botsort$ python3 v5_botsort_video_speed-2.py --weights ./weights/best_17.pt --sou
Traceback (most recent call last):
File “v5_botsort_video_speed-2.py”, line 368, in
device = select_device(opt.device)
File “/home/zhz/yolov5-botsort/utils/torch_utils.py”, line 118, in select_device
assert torch.cuda.is_available() and torch.cuda.device_count() >= len(device.replace(‘,’, ‘’)),
AssertionError: Invalid CUDA ‘–device 0’ requested, use ‘–device cpu’ or pass valid CUDA device(s)

推论

问题可能出在商家安装的驱动不兼容或不完整,导致出现如上错误。

尝试解决方案一:重装驱动,但要确保跟多个系统内容兼容(GPU、cuda版本、PyTorch版本)。查阅三者版本如下:

在这里插入图片描述

对应所有工具,找交集的驱动版本:

在这里插入图片描述

安装,Okay。

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐