Python导入错误:找不到nvcuda.dll

时间:2018-02-01 06:19:05

标签: python windows tensorflow dll cuda

ImportError:找不到'nvcuda.dll'。 TensorFlow要求将此DLL安装在%PATH%环境变量中指定的目录中。通常它安装在'C:\ Windows \ System32'中。如果不存在,请确保您具有支持CUDA的GPU并安装了正确的驱动程序。

我在MBP上安装了Windows,Intel Iris 5100显卡。我用Tensorflow安装了Python Anaconda。我还从nvidia安装了CUDA Toolkit v9.0(即使我没有nvidia gpu)。

导入tensorflow作为tf工作,但是当我运行我的程序时,我得到相同的错误。

完整日志:

C:\Users\User\Desktop\nmt-chatbot>python train.py
Traceback (most recent call last):
  File "C:\Users\User\Anaconda3\lib\site-
packages\tensorflow\python\platform\self_check.py", line 62, in 
preload_check
    ctypes.WinDLL(build_info.nvcuda_dll_name)
  File "C:\Users\User\Anaconda3\lib\ctypes\__init__.py", line 348, in 
  __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "train.py", line 7, in <module>
    from nmt import nmt
  File "C:\Users\User\Desktop\nmt-chatbot/nmt\nmt\nmt.py", line 26, in 
  <module>
    import tensorflow as tf
  File "C:\Users\User\Anaconda3\lib\site-packages\tensorflow\__init__.py", 
  line 24, in <module>
    from tensorflow.python import *
  File "C:\Users\User\Anaconda3\lib\site-
  packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\User\Anaconda3\lib\site-
  packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
    self_check.preload_check()
  File "C:\Users\User\Anaconda3\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.

0 个答案:

没有答案