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


边栏推荐
- JSP中如何借助response对象实现页面跳转呢?
- 计算机复试面试问题(计算机面试常见问题)
- ERROR 1819 (HY000) Your password does not satisfy the current policy requirements
- Two methods of NameNode failure handling
- SAP e-commerce cloud Spartacus SSR Optimization Engine execution sequence of several timeouts
- 硬盘分区,拓展C盘,不重装系统,不重装D盘软件的全教程。
- PyQt5 rapid development and actual combat 10.1 Get city weather forecast
- Ali on three sides: MQ message loss, repetition, backlog problem, how to solve?
- Sliding window method to segment data
- Flutter keyboard visibility
猜你喜欢

IDEA如何运行web程序

关于MySQL主从复制的数据同步延迟问题

PyQt5 rapid development and actual combat 9.7 Automated testing of UI layer

跨境电商小知识之跨境电商物流定义以及方式讲解
![[Niu Ke brush questions - SQL big factory interview questions] NO3. E-commerce scene (some east mall)](/img/a6/8d53f5087a33c2bea8c99a5bb922da.png)
[Niu Ke brush questions - SQL big factory interview questions] NO3. E-commerce scene (some east mall)

NameNode (NN) and SecondaryNameNode (2NN) working mechanism

Golang - gin - pprof - use and safety

深圳某游戏研发公司每个工位都装监控,网友:堪比“坐牢”!

go使用makefile脚本编译应用

golang-gin-pprof-使用以及安全问题
随机推荐
生产力工具和插件
C# 中的Async 和 Await 的用法详解
六石编程学:不论是哪个功能,你觉得再没用,会用的人都离不了,所以至少要做到99%
图像大面积缺失,也能逼真修复,新模型CM-GAN兼顾全局结构和纹理细节
The importance of strategic offensive capability is much higher than strategic defensive capability
五种数据提交方式的优化
NameNode故障处理的两种方法
C#使用ComboBox控件
JSP response对象简介说明
IDEA连接MySQL数据库并执行SQL查询操作
C#获得网卡信息 NetworkInterface IPInterfaceProperties
Flutter键盘可见性
Two methods of NameNode failure handling
中望3D 2023正式发布,设计仿真制造一体化缩短产品开发周期
What should I do if selenium is reversed?
SAP 电商云 Spartacus UI 和 Accelerator UI 里的 ASM 模块
基本语法(一)
Centos7 install mysql5.7
尚硅谷–MySQL–基础篇(P1~P95)
docker部署完mysql无法连接