ImportError: DLL load failed: 找不到指定的模块

152 次浏览
Mr.Z::

刚听说pytorch支持windows了,马上来试试。谁知道还是不行...

报错:

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2018.1.2\helpers\pydev\pydev_run_in_console.py", line 52, in run_file
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm 2018.1.2\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:/Users/mr_z/Desktop/py/_.py", line 2, in <module>
    import torch
  File "C:\Program Files\JetBrains\PyCharm 2018.1.2\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 19, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\Users\mr_z\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\__init__.py", line 78, in <module>
    from torch._C import *
  File "C:\Program Files\JetBrains\PyCharm 2018.1.2\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 19, in do_import
    module = self._system_import(name, *args, **kwargs)
ImportError: DLL load failed: 找不到指定的模块。


代码:

from __future__ import print_function
import torch

x = torch.rand(5, 3)
print(x)
3 回答 04-25
浮生若梦

你哪个版本?

1 评论 1 04-25
Ξ魂牵梦萦Ξ

肯定是你打开的方式不对

1 评论 2 07-11
需要登录后才能回答哟~ 点击