OSError: [WinError 127] The specified procedure could not be found

OSError: [WinError 127] The specified procedure could not be found

在导入 torch (import torch) 时,我遇到以下错误消息: OSError: [WinError 127] The specified procedure could not be found. Error loading "C:\Users\myUserName\anaconda3\lib\site-packages\torch\lib\jitbackend_test.dll" or one of its dependencies.

我尝试了 的建议,但没有成功。

有什么解决办法吗?

我的环境:

幸运的是,经过大量研究,我找到了解决方案。 有人建议我创建一个新的 conda 环境。这对我有用!

解法:

  1. 通过以下方式创建新的 conda 环境:conda create --name new-env
  2. 安装python:conda install python=3.8.5
  3. 运行: conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
  4. 测试库达:import torch; print(torch.version.cuda); print(torch.cuda.is_available())