当前位置:网站首页>Install the latest pytorch gpu version
Install the latest pytorch gpu version
2022-07-31 13:16:00 【BRYTLEVSON】
pytorch gpuThe latest version is installed
It's been a long time since I wrote one, Just about to install the latest,今天分享一下
1. 创建虚拟环境
Either of the following environments is supported:
- 使用conda
- 使用pythonCorresponding virtual environment management tools, etc virtualenv
- 主环境
Skip this specific step
2. 使用conda来实践
1. 环境
- 使用condato create apytorch190 python版本为3.9的虚拟环境
conda create -n pytorch190 python=3.9

2. 查看本电脑的gpu
- Device management to check the graphics card version

- Go to the NVIDIA driver official website to check the corresponding
驱动官网
My own driver version
查询结果 我自己的是511.79
到英伟达toolkit网站Check out your own versioncompoets版本以及自己的CUDA 版本
知道自己的cuda版本之后,就可以安装gpu版本的torch了
3. 安装torch
- 到pytorch官网
pytorch官网
选择自己cuda对应最新版本的pytorch版本,我选择了最新的1.9.0版本

2. Enter the virtual environment and execute the installation command
安装方式1 conda安装
进入虚拟环境
activate pytorch190
安装方式1
conda install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 cudatoolkit=10.2 -c pytorch
注意
注意 -c pytorch不能少,Less installation timegpu版本
安装方式2 pip安装
进入虚拟环境
activate pytorch190
安装方式1
pip install torch==1.9.0+cu102 torchvision==0.10.0+cu102 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
注意
Tsinghua source cannot be used here,If it is Tsinghuayuan,一定要删除,Otherwise when installedcpu版本的,这里一定要注意.
查看channel
conda config --show
conda config --get channels
# 添加源
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels http://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels http://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels http://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels http://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels http://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels http://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
#pytorch
conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/cloud/pytorch/
# 删除源
conda config --remove channels CHANNEL
总结
The above two methods of installation are foreign downloads,好几个G很慢
My solution is,自己到 https://download.pytorch.org/whl/torch_stable.html
pytorch官方库下载
下载对应的版本 然后cmd pip install 手动安装即可
测试安装成功
import torch
torch.cuda.is_available()
True


边栏推荐
- golang-gin-优雅重启
- PyQt5快速开发与实战10.2 复利计算 && 10.3 刷新博客点击量
- SAP message TK 248 solved
- docker部署完mysql无法连接
- Google Chrome(谷歌浏览器)安装使用
- ASM module in SAP Ecommerce Cloud Spartacus UI and Accelerator UI
- Error: npm ERR code EPERM
- Introduction to the PartImageNet Semantic Part Segmentation dataset
- EasyMock日记1[通俗易懂]
- 基于高阶微分器的无模型滑模控制器及其在自动电压调节器中的应用
猜你喜欢
随机推荐
Flutter键盘可见性
C#控件CheckBox的使用
CentOS7 - yum install mysql
docker部署完mysql无法连接
/run/NetworkManager占用空间过大
JSP response对象简介说明
anaconda虚拟环境安装pytorch gpu版本
NameNode (NN) 和SecondaryNameNode (2NN)工作机制
STM32——软件SPI控制AD7705[通俗易懂]
战略进攻能力的重要性,要远远高于战略防守能力
Centos7 install mysql5.7 steps (graphical version)
基于模糊预测与扩展卡尔曼滤波的野值剔除方法
C#控件 ToolStripProgressBar 用法
golang八股文整理(持续搬运)
alert(1) (haozi.me)靶场练习
五种数据提交方式的优化
操作符详解
Adding data nodes and decommissioning data nodes in the cluster
Error IDEA Terminated with exit code 1
PyQt5快速开发与实战 9.7 UI层的自动化测试
![[CPU Design Practice] Simple Pipeline CPU Design](/img/83/e1dfedfe2b2cfe83a34f86e252caa7.jpg)







