在Windows上安装TensorFlow(Python 3.6.x)

Tob*_*rth 27 python installation python-3.x tensorflow

我正在尝试在Windows上安装TensorFlow.

我尝试安装它pip,但我总是得到相同的错误消息:

... is not a supported wheel on this platform.
Run Code Online (Sandbox Code Playgroud)

我首先尝试使用Python 3.5.1,现在我升级到3.6.0b4,但它没有任何区别.


蟒蛇:

Python 3.6.0b4 (default, Nov 22 2016, 05:30:12) [MSC v.1900 64 bit (AMD64)] on win32
Run Code Online (Sandbox Code Playgroud)

PIP:

pip 9.0.1 from ...\python\lib\site-packages (python 3.6)
Run Code Online (Sandbox Code Playgroud)

确切地说,我尝试了以下两个命令:

pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl
Run Code Online (Sandbox Code Playgroud)

他们输出以下内容:

> tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
> tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
Run Code Online (Sandbox Code Playgroud)

有谁知道如何解决这个问题?我不确定我在哪里弄错了.

谢谢!


编辑1

顺便说一句,我也尝试过pip install tensorflowpip install tensorflow-gpu类似建议在这里.我得到以下输出:

> Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow
> Could not find a version that satisfies the requirement tensorflow-gpu (from versions: ) No matching distribution found for tensorflow-gpu
Run Code Online (Sandbox Code Playgroud)

Tob*_*rth 32

更新于15.11.2017

似乎到现在它的工作方式与人们期望的一样.使用以下pippython版本运行以下命令应该有效.


使用Python 3.6.x进行安装


Python:3.6.3
pip:9.0.1


安装命令

下面的命令是基于以下安装指南这里.

使用cmd

C:> pip3 install --upgrade tensorflow // cpu
C:> pip3 install --upgrade tensorflow-gpu // gpu
Run Code Online (Sandbox Code Playgroud)

使用Anaconda

C:> conda create -n tensorflow python=3.5 
C:> activate tensorflow
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow-gpu 
Run Code Online (Sandbox Code Playgroud)

附加信息

可以在此处找到常见安装问题的列表.

您可以在此处找到成功的tensorflow cpu安装的示例控制台输出.


旧的回应:

好的结论; 使用版本3.5.2!
目前3.5.1和3.6.x似乎都不起作用.

版本:

Python 3.5.2 pip 8.1.1 ..(python 3.5)

命令:

// cpu
C:> pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl

// gpu
C:> pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl
Run Code Online (Sandbox Code Playgroud)


Dar*_*iya 16

如果您使用的是anaconda发行版,则可以执行以下操作在新环境"tensorflow"上使用python 3.5:

conda create --name tensorflow python=3.5
activate tensorflow
conda install jupyter
conda install scipy
pip install tensorflow
# or
# pip install tensorflow-gpu
Run Code Online (Sandbox Code Playgroud)

在第一行的末尾添加python = 3.5非常重要,因为它将安装Python 3.5.

资料来源:https://github.com/tensorflow/tensorflow/issues/6999#issuecomment-278459224


小智 6

经过大量搜索并尝试安装并重新安装Python后,我发现解决方案非常简单

对Windows使用以下内容

python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

在Mac上更改为以下内容

python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

对于Anaconda使用相应的conda


小智 5

Tensorflow现在可用于python 3.6.4,不要使用3.6.4之后的python构建,最重要的是tensorflow在Python 3.7.2上不起作用。您可以从此处python 3.6.4下载适用于Windows的3.6.4

然后只需运行pip install tensorflow-gpu