火炬未导入:ImportError:DLL加载失败:找不到指定的模块

时间:2020-05-26 12:20:07

标签: python installation pytorch torch

我正在尝试运行包含导入割炬(pytorch)的代码。我正在使用通过anaconda导航器打开的Visual Studio代码。我收到的问题错误如下:

"...\LocalCache\local-packages\Python37\site-packages\torch\__init__.py", line 81, in <module>
    from torch._C import *
ImportError: DLL load failed: The specified module could not be found."

我尝试了多种解决方案,但似乎都不起作用。发生的一件有趣的事情是,如果我通过同一目录中的anaconda导航器打开Jupyter笔记本,我可以很好地导入手电筒并使用它。我正在使用Windows10。不胜感激!

此外,我应该在同一目录中运行它吗: -python3(在终端中打开python) -救命() -modules火炬,它返回以下内容: 这是名称或摘要包含“ torch”的模块的列表。 如果有,请输入模块名称以获取更多帮助。

caffe2.proto.torch_pb2 
caffe2.python.operator_test.torch_integration_test 
Using TensorFlow backend.opt_einsum.backends.torch - Required functions for optimized contractions of numpy arrays using pytorch.
torch - The torch package contains data structures for multi-dimensional
torchtext 
torchvision

0 个答案:

没有答案