【问题标题】:How to install the latest version of TensoFlow 2?如何安装最新版本的 TensorFlow 2?
【发布时间】:2019-12-27 11:37:39
【问题描述】:

我想知道为什么我无法安装 TensorFlow 2.0.0(直到现在的稳定版本 in their official website 甚至 in PyPi

我曾经拥有 TensorFlow 2.0.0b1 版本,但由于我的 numpy 版本与 TensorFlow 不兼容,我遇到了几个警告。它是 1.17 并且必须是 1.16.4 (Reference)。因此,我降级了它,但 TensorFlow 不再工作了。所以我决定重新安装上面提到的TensorFlow最新稳定版。

这是我到目前为止所做的:

pip install -U tensorflow

它从1.14pip show tensorflow 回溯

pip install tensorflow

它从1.14pip show tensorflow 回溯

pip install tensorflow==2.0
pip install tensorflow==2.0.0
pip install 'tensorflow>=2' 

他们抛出以下错误:

  Could not find a version that satisfies the requirement tensorflow==2.0.0 (from versions: 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)
No matching distribution found for tensorflow==2.0.0

[注意]:

操作系统:Ubuntu 16.04
Python:3.6.8
numpy:1.16.4
pip3 版本:18.1


[2020 年 10 月更新]:

显然,这个问题已经解决了,因为我现在可以在 Ubuntu 16.04 Xenial 上安装 tensorflow 2.3.1 而没有任何问题。

【问题讨论】:

  • Ubuntu 16.04 不支持manylinux2010 标签,TF 2 放弃了对manylinux1 的支持(因为 glibc 版本太旧了)。运行 python -c "from pip._internal.pep425tags import get_supported; print(get_supported())" 以验证 - manylinux2010 未列出。更新到 18.04 以获得 manylinux2010 支持。
  • @hoefling 是的,我检查过了,但不是。感谢您的回复。那么我应该在 Ubuntu 16.04 中使用2.0.0b1 版本吗?
  • @hoefling 而pip install tf-nightly呢?
  • tf-nightly 基本上是一个从当前 master 构建的轮子,因此它也不支持 manylinux1,因为最新版本不支持。不幸的是,对于 xenial,最后一个可安装的版本是 2.0.0b1。当然,您可以从源代码构建 tensorflow 或从 PPA 安装更新的 glibc,但 IMO 更简单的方法是升级到仿生(如果可以的话)。

标签: python tensorflow pip ubuntu-16.04 tensorflow2.0


【解决方案1】:

为了社区的利益,在本部分提及解决方案(即使在评论部分提及)。

以下任何步骤都可以解决问题:

  1. 使用Tensorflow 版本,2.0.0b1 用于 Ubuntu 版本 16.04 (Xenial Xerus) 或
  2. 通过将 Ubuntu 操作系统版本从 16.04 (Xenial Xerus) 升级到 18.04 (Bionic Beaver),我们可以安装最新的 Tensorflow Version

【讨论】:

  • 显然,这个问题已经解决了,因为我现在可以在 Ubuntu 16.04 Xenial上安装 tensorflow 2.3.1 没有任何问题>.
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-10-16
  • 1970-01-01
  • 2020-06-26
  • 2020-06-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多