【发布时间】:2022-05-12 05:21:05
【问题描述】:
我收到此错误 OSError: [WinError 127] The specified procedure could not be found.
OSError Traceback (most recent call last)
in
5 import matplotlib.pyplot as plt
6
----> 7 import torch
8 import torch.nn as nn
9 import torch.optim as optim
~\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\__init__.py in
79 dlls = glob.glob(os.path.join(th_dll_path, '*.dll'))
80 for dll in dlls:
---> 81 ctypes.CDLL(dll)
82
83
~\AppData\Local\Programs\Python\Python38\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error, winmode)
371
372 if handle is None:
--> 373 self._handle = _dlopen(self._name, mode)
374 else:
375 self._handle = handle
OSError: [WinError 127] La procédure spécifiée est introuvable
我几天前安装了pytorch,今天第一次遇到这个错误...所以我认为不是安装问题... 我也尝试重新安装 pytorch,但仍然出现此错误 我在 Windows 10 上使用 torch 1.5.1+cu101 和 python 3.8.5 我只安装了一个版本的python。 如果有人可以请帮助我 非常感谢
【问题讨论】:
-
我对 Python 了解不多,但第 79 到 81 行只是加载 DLL,不是吗?这表明一个或多个 DLL 要么没有加载,要么无法访问,要么实际上不兼容 DLL。检查您的 DLL 是否被阻止(如果被阻止,您的属性表上会有一个“取消阻止”按钮)。检查您的用户是否具有访问权限。还可以考虑加载特定的 DLL 而不是将它们全部通配 - 可能调试加载器以确定哪个 DLL 出现故障..