安装TensorFlow后 import tensorflow 报错

安装TensorFlow后 

import tensorflow

提示以下错误:(解决方法在最后)

tensorflow安装成功,import tensorflow时出错。

ImportError: DLL load failed: 内存位置访问无效。

During handling of the above exception, another exception occurred:


Traceback (most recent call last):


File "D:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-p


ackages\tensorflow\python\__init__.py", line 66, in


from tensorflow.python import pywrap_tensorflow


File "D:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-p


ackages\tensorflow\python\pywrap_tensorflow.py", line 21, in


_pywrap_tensorflow = swig_import_helper()


File "D:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-p


ackages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper


return importlib.import_module('_pywrap_tensorflow')


File "D:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\import


lib\__init__.py", line 126, in import_module


return _bootstrap._gcd_import(name[level:], package, level)


ImportError: No module named '_pywrap_tensorflow'


解决方法: 我安装的TensorFlow版本是tensorflow_gpu-1.1.0-cp35-cp35m-win_amd64.whl(即:TensorFlow1.1 Python3.5 Windows64位)

将版本改为cuda8.0+cudnn8.0即可正常导入。

ps:至于为什么要用这个版本我也不知道,开始的时候我用的cuda8.0+cudnn6.0就老是报上面的错

你可能感兴趣的:(深度学习,TensorFlow)