当前位置:网站首页>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
边栏推荐
猜你喜欢
五种数据提交方式的优化
How to quickly split and merge cell data in Excel
PyQt5快速开发与实战 9.7 UI层的自动化测试
CentOS7 —— yum安装mysql
golang-gin-优雅重启
Optimization of five data submission methods
C# 中的Async 和 Await 的用法详解
PyQt5 rapid development and actual combat 10.2 compound interest calculation && 10.3 refresh blog clicks
IDEA can't find the Database solution
C#控件StatusStrip使用
随机推荐
ECCV2022: Recursion on Transformer without adding parameters and less computation!
SAP e-commerce cloud Spartacus SSR Optimization Engine execution sequence of several timeouts
/run/NetworkManager占用空间过大
网络层重点协议——IP协议
Introduction to the PartImageNet Semantic Part Segmentation dataset
清除浮动的四种方式及其原理理解
Two methods of NameNode failure handling
Grab the tail of gold, silver and silver, unlock the programmer interview "Artifact of Brushing Questions"
网络协议及相关技术详解
ECCV 2022 | 机器人的交互感知与物体操作
ASM module in SAP Ecommerce Cloud Spartacus UI and Accelerator UI
anaconda虚拟环境安装pytorch gpu版本
ADS与C#通信
C#Assembly的使用
365天挑战LeetCode1000题——Day 044 最大层内元素和 层次遍历
Google Chrome(谷歌浏览器)安装使用
[Niu Ke brush questions - SQL big factory interview questions] NO3. E-commerce scene (some east mall)
Solution for browser hijacking by hao360
查看Oracle数据库的用户名和密码
使用openssl命令生成证书和对应的私钥,私钥签名,公钥验签