Anaconda | The World's Most Popular Data Science PlatformAnaconda is the birthplace of Python data science. We are a movement of data scientists, data-driven enterprises, and open source communities.https://www.anaconda.com/Get Started——>Download anaconda installer 64-Bit Graphical Installer (477 MB)https://repo.anaconda.com/archive/Anaconda3-2021.05-Windows-x86_64.exe
下载完成后安装
2、检测是否安装成功(如果之前安装过Python且版本不合适可以卸载之前版本)在Anaconda目录中,打开Anaconda prompt
输入python、conda
显示
即安装成功。
3、打开jupyter notebook进入anaconda安装文件夹,同时按住shift和右键,打开Powershell窗口
输入jupyter notebook,如打不开,则需要复制 or copy and paste one of these URLs下的网址链接
new——> Python3 shift+enter键可运行代码
(base)C:xxxxxx > 输入conda create -n pytorch python=3.8 (此处python版本需要对应下载的anaconda的版本来定)
安装环境后,切换环境
conda activate pytorch
此时环境切换为 (pytorch) C:xxxxxx >
查看环境中的包列表
pip list
此处记录pytorch官网
PyTorchAn open source machine learning framework that accelerates the path from research prototyping to production deployment.https://pytorch.org/NV显卡支持cuda
支援的GPU | GeForceCompare GeForce graphics processors that support your PC gaming system, including GPU performance and technical specifications.https://www.geforce.cn/hardware/technology/cuda/supported-gpus
备注:查看驱动是否满足方法
右键管理员身份运行命令控制台 nvidia-smi
三、安装清华镜像源 1、需要添加清华镜像源Channel(频道)在(pytorch)C:xxxxxx > (注意需先切换环境 conda activate pytorch)
输入:
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
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
2、执行安装pytorch命令conda install pytorch torchvision cudatoolkit=10.2 cudatoolkit=10.2需要先在之前查看显卡所支持的最大cudatoolkit的值
3、检查pytorch是否安装成功(pytorch)C:xxxxxx > python
......
>>>import torch
如没有报错,即为安装成功,否则安装失败
如果失败原因为缺少包:退出exit() python命令
(pytorch)C:xxxxxx > pip install 包名 例如 pip install numpy
4、查看cuda是否成功


