显卡RTX 3090运行pytorch报错CUDA error: no kernel image is available for execution on the device

安装的cuda是11.6, 注意不是cudatoolkit.

尝试了各种卸载安装torch 与 torchvision. 主要目的是跑yolov7.

最后在卸载 torch torchvision cudatoolkit之后, 用下面这个方式安装,解决了这个问题.

pip3 install torch==1.11.0 torchvision==0.12.0 torchaudio --extra-index-url https://download.pytorch.org/whl/cu113 

注意到yolov7 requirements.txt 中限制了torch1.12.0, 当时猜测应该还没出1.13.0, 如果安装了1.13.0, 也是跑步起来,会报一个 indices 不能同时在cpu和gpu的问题, 这个有前辈说是torch本身的问题.那么就安装1.11.0.

你可能感兴趣的:(随笔记录,pytorch,深度学习,人工智能)