在Windows上使用Pip Python安装TensorFlow

6

上个月他们发布了与Windows兼容的TensorFlow。查看文档后,我安装了Python 3.6并运行了以下命令:

pip install tensorflow-gpu 

但它找不到它,因此无法安装它。
could not find a version that satisfies the requirements tensorflow-gpu(from versions)

我是否漏掉了一些基础知识?如何修复或规避这个问题?


1
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-0.12.0-cp35-cp35m-win_amd64.whl - Natecat
4个回答

11

Python 3.6 的稳定版已于2016年12月23日在 Windows 上发布,但是我们还没有为该版本构建 TensorFlow 包。(假期后我们会考虑这个问题。)目前,您最好的选择是:

  1. 降级到 Python 3.5(64位版本),因为预构建的包支持此版本。
  2. 尝试从源代码构建 TensorFlow

11

以下是我为了在Windows上使用TensorFlow所做的步骤:

下载Python 3.5.0(64位)从Python发行版 for Windows。安装后,在命令提示符中运行以下命令检查Python版本:

python --version
Python 3.5.0

然后运行以下命令以将pip升级到最新版本

python -m pip install --upgrade pip

现在使用pip安装tensorflow

pip install tensorflow

完成了,在Windows上安装了TensorFlow。下面的图片显示在您输入上述命令时会发生什么。 enter image description here

示例验证TensorFlow是否正在工作。

$ python
...
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

1

我认为您需要安装Python 3.5而不是3.6。我也遇到了同样的问题。


1
谢谢兄弟,它起作用了,我只是卸载了3.6并安装了3.5。 - Hamza

0

pip3安装tensorflow==tensorflow_version

可用的tensorflow版本:(0.12.1、1.0.0、1.0.1、1.1.0rc0、1.1.0rc1、1.1.0rc2、1.1.0、1.2.0rc0、1.2.0rc1、1.2.0rc2、1.2.0、1.2.1、1.3.0rc0、1.3.0rc1、1.3.0rc2、1.3.0、1.4.0rc0、1.4.0rc1、1.4.0、1.4.1、1.5.0rc0、1.5.0rc1、1.5.0、1.5.1、1.6.0rc0、1.6.0rc1、1.6.0、1.7.0rc0、1.7.0rc1、1.7.0、1.7.1、1.8.0rc0、1.8.0rc1、1.8.0、1.9.0rc0、1.9.0rc1、1.9.0rc2、1.9.0、1.10.0rc0、1.10.0rc1、1.10.0、1.10.1、1.11.0rc0、1.11.0rc1、1.11.0rc2、1.11.0、1.12.0rc0、1.12.0rc1、1.12.0rc2、1.12.0、1.12.2、1.12.3、1.13.0rc0、1.13.0rc1、1.13.0rc2、1.13.1、1.13.2、1.14.0rc0、1.14.0rc1、1.14.0、2.0.0a0、2.0.0b0、2.0.0b1)


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接