在Windows 10上安装tensorflow-gpu

时间:2018-04-02 03:03:39

标签: python windows tensorflow

我找到了有关python3的所有信息,但找不到任何关于python2的信息。

> pip install --upgrade tensorflow-gpu
    Collecting tensorflow-gpu
    Could not find a version that satisfies the requirement tensorflow-gpu (from versions: )
    No matching distribution found for tensorflow-gpu

我跟着https://www.tensorflow.org/install/install_windows#CommonInstallationProblemshttp://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/安装了CUDA,我得到了:

> nvcc -V
    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2017 NVIDIA Corporation
    Built on Fri_Nov__3_21:08:12_Central_Daylight_Time_2017
    Cuda compilation tools, release 9.1, V9.1.85

所以我觉得我在这方面很好。 我只需要pip命令来安装tensorflow-gpu

我找到了一个tensorflow-gpu版本的链接应该可以使用,复制链接并尝试但是我明白了:

> pip install --upgrade https://pypi.python.org/packages/23/ad/63ae65999fd42a3e8d0044245e52513b31764167797651bef3ceb5202001/tensorflow_gpu-1.7.0-cp36-cp36m-win_amd64.whl#md5=7d780aa2c9f73c1ea9d3b87422aca096
    tensorflow_gpu-1.7.0-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.

修改

所以我卸载python2并重新安装python3但它仍然不起作用:

> pip --version
    pip 9.0.3 from c:\program files (x86)\python36-32\lib\site-packages (python 3.6)
> pip install --upgrade tensorflow-gpu
    Collecting tensorflow-gpu
    Could not find a version that satisfies the requirement tensorflow-gpu (from versions: )
    No matching distribution found for tensorflow-gpu

修改

我写了一篇关于它的文章:https://leobenkel.com/2018/04/tensorflow-gpu-windows10-tutorial/

2 个答案:

答案 0 :(得分:0)

目前Tensorflow仅支持Python版本3.5和3.6的 64位安装

  

如果您没有安装以下版本的Python之一   机器,现在安装:

Python 3.5.x 64-bit from python.org
Python 3.6.x 64-bit from python.org

检查TensorFlow网站以获取更多details

答案 1 :(得分:0)

当我尝试安装基于gpu的tensorflow时,发现了相同的问题,那就是版本不令人满意。我在搜索后发现的问题的解决方案是,如果您当前正在安装最新版本的python,则假设一开始我已经安装了python3.7.x,而当我尝试安装gpu版本的tensorflow时,问题就出现了。原因是针对python新版本的tensorflow-gpu尚未发布。因此,您必须安装较高的版本(例如python3.6版本类型)才能使其正常工作。 祝你好运!