Skip to main content
 首页 » 编程设计

python之如何设置tensorflow的默认版本

2025年02月15日26落叶无声

各位

我遇到了一个问题,我安装了两个版本的TensorFlow,如下图。

two versions of tensorflow

默认版本为 TensorFlow 1.1.0。见下文。

the default version of tensorflow

如何更改默认版本?

请您参考如下方法:

如果你想在gpu上使用tensorflow,只需卸载tensorflow并保留tensorflow-gpu。然后,您将在执行 import tensorflow 时获得 gpu 版本。

另外,最新的tf gpu版本是1.1.0。您可以使用 conda 或 pip 对其进行升级。