一、安装CUDA
二、Anaconda安装
三、Pytorch安装
先打开Anaconda进行Pip换源
清华源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
阿里源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
腾讯源
pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple
豆瓣源
pip config set global.index-url http://pypi.douban.com/simple/#
换回默认源pip config unset global.index-url
1.下载Pytorch
在cmd输入nvidia-smi
查看cuda版本,我这里是11.6
Pytorch安装包下载
直接搜索对应cuda版本的Pytorch,我是cuda11.6,搜cu116,如果没有对应版本,可以安装低版本的,把torchvision也下了
2.安装Pytorch以及相应的包
进Anaconda创建对应环境之后输入pip install torch文件地址
回车安装即可
torchvision也是一样的步骤,pip会自动安装所需的包
然后pip install d2l
基本上深度学习要用到的库都安装全了