Install conda
Anconda download and installation
Download python3.7 version on Anconda official website
TensorFlow installation
打开Anconda Prompt
创建conda虚拟环境
用create -n 新建一个名叫TF2.1的环境用python3.7版本
conda create -n TF2.1 python=3.7
进入tensorflow2.1环境
conda activate TF2.1
安装英伟达的SDK10.1版本
conda install cudatoolkit=10.1
安装英伟达深度学习软件包7.6版本
conda install cudnn=7.6
如果你的GPU不支持英伟达,可以直接跳过上面两步,直接安装TensorFlow
安装TensorFlow
用pip install tensorflow==2.1指定2.1版本
安装完成后进入python环境验证是否安装成功
控制台输入python
import tensorflow as tf
查看TensorFlow版本
tf.__version__
如果显示2.1.0说明安装成功了
PyCharm download and installation
The installation is carried out step by step.
Create a new project.
Choose the default path.
Set the project path.
Set environment variables.
Use the just configured conda environment.
Select the just configured TF2.1 as the python interpreter.
If the network is not good, it is recommended to add the following Tsinghua mirror and try again
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/
conda config --set show_channel_urls yes