1. Install version
Python 3.8.5
tf-nightly-gpu 2.5.0
Anaconda3-2020.11-Windows-x86_64
2. Download Anaconda
3. Enter the installation command in Anaconda Prompt
conda create -n tensorflow-gpu python=3.8.5
activate tensorflow-gpu
conda install -c conda-forge cudnn
pip install tf-nightly-gpu
国内镜像安装:
pip install tf-nightly-gpu -i https://pypi.tuna.tsinghua.edu.cn/simple
或者
pip install tensorflow-gpu==2.3.0 --default-timeout=10000 -i https://pypi.doubanio.com/simple
conda install scipy pillow
conda install jupyterlab
conda install scikit-learn
conda install matplotlib (pip install matplotlib)
conda install pandas(conda install openpyxl)
conda install -c conda-forge opencv
conda install -c conda-forge lightgbm
pip install xgboost -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install SimpleITK -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install pyradiomics -i https://pypi.tuna.tsinghua.edu.cn/simple/
jupyter notebook
Note: When the conda installation is too slow, Windows users cannot directly create .condarc
a file named , they can first execute conda config --set show_channel_urls yes
to generate the file and then modify it.
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
Run conda clean -i
to clear the index cache, and ensure that the index provided by the mirror site is used.
4. Check whether the installation is successful
import tensorflow as tf
print(tf.__version__)
tf.config.list_physical_devices()
Successful installation!