import TensorFlow:[WinError 126]找不到指定的模块

2024-06-28 19:29:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我想学习使用TensorFlow,但是,当然,我甚至不能安装它!在

以下是关于我案件的信息:

  • Python 3.6 64位
  • 英特尔(R)高清图形520
  • 英特尔i7
  • Windows 7系统
  • 纽比1.14.1

我遵循以下步骤:

  1. 命令:C:\> pip3 install --upgrade tensorflow-gpu
  2. 在Python上:import tensorflow

但我得到了以下错误:

Traceback (most recent call last):
  File "C:\Users\VES\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\self_check.py", line 62, in preload_check
    ctypes.WinDLL(build_info.nvcuda_dll_name)
  File "C:\Users\VES\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import tensorflow
  File "C:\Users\VES\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "C:\Users\VES\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\VES\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
    self_check.preload_check()
  File "C:\Users\VES\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\self_check.py", line 70, in preload_check
    % build_info.nvcuda_dll_name)
ImportError: Could not find 'nvcuda.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Typically it is installed in 'C:\Windows\System32'. If it is not present, ensure that you have a CUDA-capable GPU with the correct driver installed.

Tags: inpylibpackageslocaltensorflowcheckline
1条回答
网友
1楼 · 发布于 2024-06-28 19:29:56

要运行支持GPU的tensorflow,需要安装NVIDIA显卡和CUDA库(请参见requirements here),不幸的是,Intel(R)HD Graphics 520不行。在

您可以接受CPU版本(pip3 install upgrade tensorflow),这对于开始学习还是很好的。在

更新:另一个解决方案是使用在线服务Google Colab,它允许您从Google的云基础设施借用GPU用于学习。在

相关问题 更多 >