使用anaconda安装gpu版本tensorflow
1、在anaconda prompt 创建虚拟环境
conda create tensorflow2
2、下载tensorflow(直接下载最新版)(要保证cuda的版本是否ok)
pip install tensorflow-gpu
3、激活虚拟环境
activate tensorflow2
4(1)、下载后出现错误—使用清华镜像
Anaconda An HTTP error occurred when trying to retrieve this URL.HTTP errors are often intermittent,
清华镜像网址:
https://mirror.tuna.tsinghua.edu.cn/help/anaconda/
4(2)、解决上面问题后
conda env list
查看此时conda里存在的虚拟环境
但是在jupyter和speder里依然显示没有tensorflow
直接以管理员身份运行prompt
大概是因为tensorflow只在虚拟环境tensorflow2 中
但是jupyter和speder所在的base里并没有
所以在base里再安装一次
conda install -n base tensorflow
成功!!!