Installation 进口火炬操作错误:[WinError 127]
我正在尝试安装torch gpu。我已经通过命令Installation 进口火炬操作错误:[WinError 127],installation,import,torch,oserror,Installation,Import,Torch,Oserror,我正在尝试安装torch gpu。我已经通过命令pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1-f安装了cuda 11.1和torchhttps://download.pytorch.org/whl/torch_stable.html 这太愚蠢了,但在导入过程中,我出现了以下错误:OSError:[WinError 127]加载“C:\Users\User\AppData\Roaming\Pyt
pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1-f安装了cuda 11.1和torchhttps://download.pytorch.org/whl/torch_stable.html
这太愚蠢了,但在导入过程中,我出现了以下错误:OSError:[WinError 127]加载“C:\Users\User\AppData\Roaming\Python\Python38\site packages\torch\lib\c10\u cuda.dll”或其依赖项时出错。
c10_cuda.dll存在于该目录中,我花了几天时间仍然无法解决它。我需要torch gpu,这就是使用这种可能性的意义所在,请不要评论“安装torch cpu”。自己回答这个问题
要安装torch gpu,应:
nvcc--version
conda install pytorch torchvision torchaudio cudatoolkit=11.1-c pytorch-c conda forge
)
导入torch torch.cuda.is\u available()
pip卸载torch
,并使用conda clean-a
以成功结束安装