1,安装anaconda3.8
2,下载并安装cuda和cudnn
3,创建python=3.7的环境
4,安装tensorflow。
5,tensorflow版本号和cuda、cudnn这两者版本号要匹配
其他操作:
1:更改下载地址为国内源,只需在cmd输入:
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
2:使用conda list
命令查看当前环境下安装的各种包,使用nvcc --version
来查看当前虚拟环境下生效的cuda版本号。
3:使用conda remove tensorflowxxxx
来删除误安装的与cuda和cudnn以及python版本号不匹配的版本,然后再重新安装。
4:某些镜像源地址可能会删除资料,因此需要广泛添加源通道。
5:在cmd框口验证安装成功后,使用conda install nb_conda
命令安装插件后,才可以在jupyter notebook中自由切换虚拟环境。