当前位置:网站首页>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


边栏推荐
- 电商rpa是什么意思?跟电商rpi是一个意思吗?
- ASM module in SAP Ecommerce Cloud Spartacus UI and Accelerator UI
- 报错:npm ERR code EPERM
- 报错IDEA Terminated with exit code 1
- golang中使用泛型
- 中望3D 2023正式发布,设计仿真制造一体化缩短产品开发周期
- How IDEA runs web programs
- alert(1) (haozi.me)靶场练习
- What should I do if selenium is reversed?
- IDEA的database使用教程(使用mysql数据库)
猜你喜欢
随机推荐
C# 中的Async 和 Await 的用法详解
PyQt5 rapid development and actual combat 10.2 compound interest calculation && 10.3 refresh blog clicks
networkx绘制度分布
NPM 使用介绍
基于去噪自编码器的故障隔离与识别方法
centos7安装mysql5.7步骤(图解版)
365-day challenge LeetCode1000 questions - Day 044 Maximum element in the layer and level traversal
The operator,
Error: npm ERR code EPERM
JSP中如何借助response对象实现页面跳转呢?
ASM module in SAP Ecommerce Cloud Spartacus UI and Accelerator UI
TensorRT安装及使用教程「建议收藏」
numpy矩阵和向量的保存与加载,以及使用保存的向量进行相似度计算
Anaconda安装labelImg图像标注软件
模拟量差分和单端(iou计算方法)
alert(1) (haozi.me)靶场练习
基于神经网络的多柔性梁耦合结构振动控制
EasyMock日记1[通俗易懂]
[RPI]树莓派监控温度及报警关机保护「建议收藏」
Verilog——基于FPGA的贪吃蛇游戏(VGA显示)








