环境

GPU:4090
CUD:11.6
torch:1.12.1
安装命令:

pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu116

报错

RuntimeError: The following operation failed in the TorchScript interpreter.
Traceback of TorchScript (most recent call last):
RuntimeError: nvrtc: error: invalid value for --gpu-architecture (-arch)

解决

更新torch,需先卸载已有torch环境,安装torch==1.13.1版本

pip uninstall torch
pip uninstall torchvision
pip uninstall torchaudio
 pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117
Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐