进入当前环境
conda activate TF2.1
安装英伟达SDK10.1的版本
conda install cudatoolkit=10.1
安装英伟达深度学习软件包
conda install cudnn=7.6
pip安装tensorflow2.1版本
pip install tensorflow==2.1
发现一片红报错,socket.timeout: The read operation timed out好像是网服务器联机不稳
解决方案1:设置超时时间
pip --default-timeout=100 install tensorflow==2.1
解决方案2(推荐):换镜像(首推豆瓣,突突的)
pip install --index https://pypi.douban.com/simple/ tensorflow==2.1
清华: https://pypi.tuna.tsinghua.edu.cn/simple
阿里云: https://mirrors.aliyun.com/pypi/simple/
中国科技大学: https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣: https://pypi.douban.com/simple/
最后进入python验证是否安装完成
python
进入python
import tensorflow as tf
tf.__version__
(注:__是双下划线)
如上显示2.1.0说明安装成功。