当我正在使用tensorflow-gpu版本时,我收到此错误。怎么解决这个?

时间:2017-10-18 10:50:33

标签: tensorflow

当我尝试将tensorflow导入python3.5时,这是我在命令提示符下出现的错误:

File "<stdin>", line 1, in <module>                                                                                                                                                                                
File "D:\S7\ml_spl\Anaconda2\envs\tensorflowGPU\lib\site-
packages\tensorflow\__init__.py", line 24, in <module>                                                                                                      
from tensorflow.python import *                                                                                                                                                                                  
File "D:\S7\ml_spl\Anaconda2\envs\tensorflowGPU\lib\site-
packages\tensorflow\python\__init__.py", line 49, in <module>                                                                                               
from tensorflow.python import pywrap_tensorflow                                                                                                                                                                  
File "D:\S7\ml_spl\Anaconda2\envs\tensorflowGPU\lib\site-
packages\tensorflow\python\pywrap_tensorflow.py", line 52, in <module>                                                                                      
raise ImportError(msg)                                                                                                                                                                                          
ImportError: Traceback (most recent call last):                                                                                                                                                                      
File "D:\S7\ml_spl\Anaconda2\envs\tensorflowGPU\lib\site-
packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in 
swig_import_helper                                                                   
return importlib.import_module(mname)                                                                                                                                                                            
File "D:\S7\ml_spl\Anaconda2\envs\tensorflowGPU\lib\importlib\__init__.py", 
line 126, in import_module                                                                                                               
return _bootstrap._gcd_import(name[level:], package, level)                                                                                                                                                      
File "<frozen importlib._bootstrap>", line 985, in _gcd_import                                                                                                                                                     
File "<frozen importlib._bootstrap>", line 968, in _find_and_load                                                                                                                                                  
File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked                                                                                                                                         
File "<frozen importlib._bootstrap>", line 666, in _load_unlocked                                                                                                                                                  
File "<frozen importlib._bootstrap>", line 577, in module_from_spec                                                                                                                                                
File "<frozen importlib._bootstrap_external>", line 938, in create_module                                                                                                                                          
File "<frozen importlib._bootstrap>", 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 "D:\S7\ml_spl\Anaconda2\envs\tensorflowGPU\lib\site-
packages\tensorflow\python\pywrap_tensorflow.py", line 41, in <module>                                                                                      
from tensorflow.python.pywrap_tensorflow_internal import *                                                                                                                                                       
File "D:\S7\ml_spl\Anaconda2\envs\tensorflowGPU\lib\site-
packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in 
<module>                                                                             
_pywrap_tensorflow_internal = swig_import_helper()                                                                                                                                                               
File "D:\S7\ml_spl\Anaconda2\envs\tensorflowGPU\lib\site-
packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in 
swig_import_helper                                                                   
return importlib.import_module('_pywrap_tensorflow_internal')                                                                                                                                                    
File "D:\S7\ml_spl\Anaconda2\envs\tensorflowGPU\lib\importlib\__init__.py", 
line 126, in import_module                                                                                                               
return _bootstrap._gcd_import(name[level:], package, level)                                                                                                                                                    
ImportError: No module named '_pywrap_tensorflow_internal'

当我尝试在安装了python3.5和其他依赖项的anaconda环境中安装tensorflow gpu版本时,我看到了上述错误。有人能告诉我如何解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

你安装了cudnn 6.0和cuda 8吗?此issue表示要么未正确安装,要么版本错误。

有关安装gpu支持的版本和步骤的说明,请参见tensorflow site