win10安装tensorflow遇到的的问题

1.安装环境:Windows10、CUDA8.0+cuDNN7.1

pip install tensorflow-gpu

默认安装了1.12.0版本

Requirement already satisfied: setuptools in c:\users\yu\appdata\local\conda\conda\envs\keras\lib\site-packages (from protobuf>=3.6.1->tensorflow-gpu) (40.6.2)
Installing collected packages: tensorflow-gpu
Successfully installed tensorflow-gpu-1.12.0

2.测试tensorflow时报错如下:

ImportError: Traceback (most recent call last):
  File "C:\Users\yu\AppData\Local\conda\conda\envs\keras\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in 
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\yu\AppData\Local\conda\conda\envs\keras\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in 
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\yu\AppData\Local\conda\conda\envs\keras\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Users\yu\AppData\Local\conda\conda\envs\keras\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\yu\AppData\Local\conda\conda\envs\keras\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: 找不到指定的模块。


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

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

3.网上查找后得到解决:配置tensorflow-gpu

pip uninstall tensorflow-gpu==1.12.0
pip install tensorflow-gpu==1.4.0

4.问题得以解决:

win10安装tensorflow遇到的的问题_第1张图片 成功解决

5.反思与总结

     之前用的是tensorflow-gpu的1.8.0版本,一直没啥问题,也是用pip装的,后来出现一些小问题用pip不能指定1.8.0的版本号了,一直安装失败,直接用conda install tensorflow-gpu==1.8.0,也是OK的,没有问题,这次这个问题用conda装也可以解决,但是就想找一下这个原因,才写了这个博客。由于前段时间因为Anaconda的内核崩了,才重新安装了anaconda,出现的问题,及时分享出来,希望大佬们评论指正,深度学习小白在此谢过。

6.问题解决引用的网址在此列出:

https://github.com/tensorflow/tensorflow/issues/22512

https://blog.csdn.net/wf15725243865/article/details/80723154

致谢以上网友分享!

你可能感兴趣的:(win10安装tensorflow遇到的的问题)