目录
工具目录
工具介绍
安装图解
anaconda
确认安装好annaconda? ?
cuda 安装
检查是否安装好cuda?
?pytorch 安装
? 配置一下anaconda 镜像?
?pycharm 安装?
?代码演示
有任何问题欢迎留言询问
工具目录
- python 3.x?+ anaconda 可以最新
- CUDA 11.2?? 英伟达显卡
- pycharm community? 社区版 最新即可?
工具介绍
- anaconda? python 的包管理工具? ? 自动的下载管理第三方的软件库的管理工具?
- cuda? 针对英伟达显卡的并行计算库?
- pycharm community? ?免费社区版? python 代码的编辑工具?
安装图解
anaconda
官方地址??Anaconda | Anaconda Distribution
安装 anaconda 会自带安装python? 注 python3.x 向下兼容? ,安装最新版没有问题

?注意勾选? 添加到path 路径? 为了方便使用conda 这个命令
确认安装好annaconda? ?
cmd? conda --version? 如果能敲出conda 这个命令说明已经安装好了conda

cuda 安装
?cuda 只能安装在 NVIDIA显卡上面? 根据自己电脑选着对应下载? 下载好点击安装? 安装过程中关闭安全软件? 本次教程安装 cuda 11.2 (注:截图版本为 11.6.2)

?
?
?

检查是否安装好cuda?
cmd? nvcc -V? ?注意 V 是大写? ?

?pytorch 安装
?进入官网? ?Start Locally | PyTorch? ?复制红框内容 粘贴到cmd注意cmd以管理员方式运行? Y
? 配置一下anaconda 镜像?
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/pytorch/ conda config --set show_channel_urls yes
使用国内源去掉 -c pytorch
conda install pytorch torchvision torchaudio cudatoolkit=11.3
?安装的cuda 版本和此处要一致


?pycharm 安装?
官网?Download PyCharm: Python IDE for Professional Developers by JetBrains
社区版个人学习够用? 双击安装? ?新建项目? 配置pyhon conda 环境?

代码演示
import torch
print(torch.__version__)
print('gpu:',torch.cuda.is_available())

有任何问题欢迎留言询问
|