2017-05-01 2 views
-1

zu importieren, erhalte ich den folgenden Fehler beim Versuch, TensorFlow zu importieren. Ich habe versucht, zurück zu C++ Redist zu rollen. 2015 (ab 2017) und immer noch nicht funktioniert. Win10, Python 3,5 (64)ImportError: Laden der DLL fehlgeschlagen: Das angegebene Modul konnte nicht gefunden werden. Beim Versuch, TensorFlow

Traceback (most recent call last): File "C:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper return importlib.import_module(mname) File "C:\Python35\lib\importlib_init_.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 958, in _find_and_load_unlocked File "", line 666, in _load_unlocked File "", line 577, in module_from_spec File "", line 914, in create_module File "", line 222, in _call_with_frames_removed ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper return importlib.import_module('pywrap_tensorflow_internal') File "C:\Python35\lib\importlib_init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "C:\Python35\lib\site-packages\tensorflow_init_.py", line 24, in from tensorflow.python import * File "C:\Python35\lib\site-packages\tensorflow\python_init_.py", line 51, in from tensorflow.python import pywrap_tensorflow File "C:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 52, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper return importlib.import_module(mname) File "C:\Python35\lib\importlib_init_.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 958, in _find_and_load_unlocked File "", line 666, in _load_unlocked File "", line 577, in module_from_spec File "", line 914, in create_module File "", line 222, in _call_with_frames_removed ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper return importlib.import_module('pywrap_tensorflow_internal') File "C:\Python35\lib\importlib_init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: No module named '_pywrap_tensorflow_internal'

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.

+0

Installiert die Nicht-GPU-Version und es funktioniert. Irgendwelche Ideen, wie man die GPU Version erhält, angesichts der oben genannten Fehler? –

+1

Wenn es die Nicht-GPU-Version funktioniert, aber die GPU-Version nicht, deutet dies auf ein Problem mit der CUDA-Installation hin. Können Sie sicherstellen, dass sich die DLLs für CUDA 8.0 und cuDNN 5.1 in Verzeichnissen in Ihrer Umgebungsvariablen '% PATH%' befinden? – mrry

+0

Wenn Sie Tensorflow 1.3 verwenden, dann möchten Sie 6.0 verwenden https://github.com/tensorflow/tensorflow/issues/7705 –

Antwort

2

Meine Arbeits Setup in Windows 10 und GTX960M:

  • installieren Python 3.5.x
  • Microsoft Visual Studio 2015 Community Edition.
  • Downloaden und installieren CUDA toolkit 8.0
  • Laden Sie CuDNN v5.1 herunter.
  • Legen Sie CUDA_HOME (\ CUDA) und% CUDA_HOME% \ bin in PATH.
  • Extrahieren Sie die cuDNN-Dateien in einen Ordner und fügen Sie diesen Speicherort hinzu (der Ordner bin, lib, include-Ordner), stellen Sie auch sicher, dass cuDNN-DLLs in% PATH% richtig eingestellt sind.
  • Kopieren Sie die entsprechenden Dateien von cuDNN in Ordner in Cuda-Installationsverzeichnis (Das löste meine Probleme): cudnn64_5.dll nach C: \ Programme \ NVIDIA GPU Computing Toolkit \ CUDA \ v8.0 \ bin kopieren. kopieren Sie cudnn.h nach C: \ Programme \ NVIDIA GPU Computing Toolkit \ CUDA \ v8.0 \ include. Kopieren Sie cudnn.lib nach C: \ Programme \ NVIDIA GPU Computing Toolkit \ CUDA \ v8.0 \ lib \ x64.
  • Stellen Sie sicher, dass ich MSVCP140.dll in C: \ Windows \ System32 und C: \ Windows \ SysWOW64 habe. Wenn es nicht von hier herunterladen: https://www.microsoft.com/en-us/download/details.aspx?id=53587 und installieren Sie es.

Ich glaube stark, dass diese Versionierung in diesem Fall ein bisschen wichtig ist. Ich habe versucht mit cuDNN 6.0, die fehlgeschlagen. aber 5.1 hat funktioniert.

+0

Dies hilft definitiv! – mohanaravind

+0

Wenn Sie Tensorflow 1.3 verwenden, möchten Sie CuDNN 6.0 https://github.com/tensorflow/tensorflow/issues/7705 verwenden –

Verwandte Themen