pip
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple *****
conda install
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
删除添加的源,恢复官方源
conda config --remove-key channels
查看源的优先权,
$ conda config --get channels
##下面的是输出
--add channels 'defaults' # lowest priority
--add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
--add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/' # highest priority
tensorflow1.7
tensorflow在2.0之前的GPU版本和CPU版本是分开的,tensorflow在2.0后的版本不用区分GPU和CPU版本。
conda create -n tf17 python==3.6.10
source activate tf17
conda install cudatoolkit==9.0
conda install cudnn==7.0
pip install tensorflow-gpu==1.7.0
pip install keras==2.1.6
tensorflow1.14
conda create -n tf114 python==3.6.10
source activate tf114
conda install cudatoolkit==10.0.130
conda install cudnn==7.4.1
pip install tensorflow-gpu==1.14.0
pip install keras==2.2.5
tensorflow2.2
conda create -n tf22 python==3.7.10
source activate tf22
conda install cudatoolkit==10.1
conda install cudnn==7.6
pip install tensorflow==2.2.0
pip install keras==2.4.3
tensorflow2.4
conda create -n tf24 python==3.7.10
source activate tf24
conda install cudatoolkit==11.0
conda install cudnn==8.0
pip install tensorflow==2.4.1
pip install keras==2.4.3
利用上述命令,理论上可以安装好对应的tensorflow-gpu版本。