当前位置:网站首页>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
边栏推荐
- selenium被反爬了怎么办?
- ECCV2022: Recursion on Transformer without adding parameters and less computation!
- 报错:npm ERR code EPERM
- Using SQL Server FOR XML and FOR JSON syntax on other RDBMSs with jOOQ
- ASM module in SAP Ecommerce Cloud Spartacus UI and Accelerator UI
- Flutter keyboard visibility
- How to quickly split and merge cell data in Excel
- C# 中的Async 和 Await 的用法详解
- SAP message TK 248 solved
- Talk about the message display mechanism on the SAP product UI
猜你喜欢
How IDEA runs web programs
PyQt5 rapid development and actual combat 10.1 Get city weather forecast
networkx绘制度分布
centos7安装mysql5.7步骤(图解版)
硬盘分区,拓展C盘,不重装系统,不重装D盘软件的全教程。
Grab the tail of gold, silver and silver, unlock the programmer interview "Artifact of Brushing Questions"
PyQt5快速开发与实战 9.7 UI层的自动化测试
AMBA APB学习记录(AMBA 2.0)
深圳某游戏研发公司每个工位都装监控,网友:堪比“坐牢”!
PyQt5 rapid development and actual combat 10.2 compound interest calculation && 10.3 refresh blog clicks
随机推荐
最新完整代码:使用word2vec预训练模型进行增量训练(两种保存方式对应的两种加载方式)适用gensim各种版本
selenium被反爬了怎么办?
分布式锁有哪些,怎么实现(分布式锁的三种实现的对比)
战略进攻能力的重要性,要远远高于战略防守能力
网络层重点协议——IP协议
golang中使用泛型
FastAPI encapsulates a generic response
Edge Cloud Explained in Simple Depth | 4. Lifecycle Management
C#控件CheckBox的使用
NameNode故障处理的两种方法
ECCV2022:在Transformer上进行递归,不增参数,计算量还少!
集群的安全模式
Batch大小不一定是2的n次幂!ML资深学者最新结论
FastAPI 封装一个通用的response
Google Chrome(谷歌浏览器)安装使用
Error IDEA Terminated with exit code 1
IDEA can't find the Database solution
C#获得网卡信息 NetworkInterface IPInterfaceProperties
滑窗法切分数据
【CPU设计实战】简单流水线CPU设计