在导入 torch (import torch
) 时,我遇到以下错误消息:
OSError: [WinError 127] 找不到指定的过程。加载“C:\Users\myUserName\anaconda3\lib\site-packages\torch\lib\jitbackend_test.dll”或其依赖项之一时出错。
我尝试了 this article 的建议但没有成功。
有什么解决办法吗?
我的环境:
- NVIDIA GeForce GTX 1650
- Windows 11
- CUDA 11.5
- conda 4.10.3
- Python 3.8.5
- torch 1.10
- 已安装 Microsoft Visual C++ Redistributable ( https://aka.ms/vs/17/release/vc_redist.x64.exe )
最佳答案
幸运的是,经过广泛研究,我找到了解决方案。 有人建议我创建一个新的 conda 环境。这对我有用!
解决方案:
- 通过以下方式创建新的 conda env:
conda create --name new-env
- 安装python:
conda install python=3.8.5
- 运行:
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
- 测试cuda:
导入torch;打印( torch .版本.cuda);打印(torch.cuda.is_available())
关于python - 操作系统错误: [WinError 127] The specified procedure could not be found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69958526/