conda 环境安装 tensorflow2.0 & tensorflow1.15

虚拟环境换台电脑就要装一次,在此记录一下吧,方便再次使用。

查看 tensorflow 和 python 对应版本可前往:在 Windows 环境中从源代码构建  |  TensorFlow

这里简单展示一下 GPU 版本的: 

tensorflow2.0 & tensorflow1.15 这两个版本的好处是要求的 python 版本和 cuda 版本都一样,所以不需要为这两种环境分别去安装不同版本的 cuda。

1、安装 tensorflow2.0 ,对应的 python 版本是 3.5-3.7,那我就装 python 3.7。我习惯把该环境命名为 tf2.0。

conda create -n tf2.0 python=3.7  # 安装 conda 虚拟环境
conda activate tf2.0  # 激活
conda install tensorflow-gpu==2.0.0  # 安装 gpu 版本的 tensorflow
# 安装常见包
pip install scikit-learn numpy 

2、安装 tensorflow1.15 ,对应的 python 版本是 3.5-3.7,那我就装 python 3.7。我习惯把该环境命名为 tf1.15。

conda create -n tf1.15 python=3.7  # 安装 conda 虚拟环境
conda activate tf1.15  # 激活
conda install tensorflow-gpu==1.15.0  # 安装 gpu 版本的 tensorflow
# 安装常见包
pip install scikit-learn numpy 

猜你喜欢

转载自blog.csdn.net/m0_37738114/article/details/131114645