2017-05-01 99 views
-1

。我試着回滾到C++ Redist。 2015(從2017年)仍然無法正常工作。 Win10,Python的3.5(64)ImportError:DLL加載失敗:指定的模塊找不到。在嘗試導入TensorFlow時嘗試導入TensorFlow時出現以下錯誤:嘗試導入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

安裝了非GPU版本,它的工作原理。鑑於上述錯誤,任何想法如何獲得GPU版本woking? –

+1

如果它是非GPU版本,但GPU版本不適用,則表明CUDA安裝存在問題。你能確保CUDA 8.0和cuDNN 5.1的DLLs在你的'%PATH%'環境變量的目錄中嗎? – mrry

+0

如果您使用tensorflow 1.3,那麼您想使用6.0 https://github.com/tensorflow/tensorflow/issues/7705 –

回答

2

我的工作建立在Windows 10和GTX960M:

  • 安裝Python 3.5.x的
  • 微軟的Visual Studio 2015年的社區版。
  • 下載並安裝CUDA工具包8.0
  • 下載CuDNN v5.1。
  • 在PATH中設置CUDA_HOME(\ CUDA)和%CUDA_HOME%\ bin。
  • 將cuDNN文件解壓縮到一個文件夾,並將該位置(bin,lib,include文件夾所在的文件夾)也添加到PATH中,確保在%PATH%中正確設置了cuDNN DLL。
  • 將各個文件從cuDNN複製到cuda安裝目錄中的文件夾(這解決了我的問題): 將cudnn64_5.dll複製到C:\ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v8.0 \ bin。 將cudnn.h複製到C:\ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v8.0 \ include。 將cudnn.lib複製到C:\ Program Files \ NVIDIA GPU計算工具包\ CUDA \ v8.0 \ lib \ x64。
  • 確保我在C:\ Windows \ System32和C:\ Windows \ SysWOW64中有MSVCP140.dll。如果沒有從這裏下載:https://www.microsoft.com/en-us/download/details.aspx?id=53587並安裝它。

我強烈地認爲這些版本在這種情況下有點重要。 我嘗試使用失敗的cuDNN 6.0。但5.1工作。

+0

這絕對有幫助! – mohanaravind

+0

如果您使用tensorflow 1.3,那麼您想使用CuDNN 6.0 https://github.com/tensorflow/tensorflow/issues/7705 –

相關問題