windows_anaconda 安装pytorch

CUDA版本

cmd

nvidia-smi
#  NVIDIA-SMI 546.56   Driver Version: 546.56  CUDA Version: 12.3

nvcc --version
# nvcc: NVIDIA (R) Cuda compiler driver
# Copyright (c) 2005-2023 NVIDIA Corporation
# Built on Wed_Nov_22_10:30:42_Pacific_Standard_Time_2023
# Cuda compilation tools, release 12.3, V12.3.107
# Build cuda_12.3.r12.3/compiler.33567101_0

python版本

cmd

C:\Windows\System32>python -V
Python 3.11.5

官网选择适配版本

Start Locally | PyTorch

pen an Anaconda prompt via:  Start | Anaconda3 | Anaconda Prompt

(base) C:\Users\yinwe>pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

Requirement already satisfied: mpmath>=0.19 in c:\users\yinwe\installed\anaconda3\lib\site-packages (from sympy->torch) (1.3.0)
Installing collected packages: typing-extensions, torch, torchvision, torchaudio
Successfully installed torch-2.2.1+cu121 torchaudio-2.2.1+cu121 torchvision-0.17.1+cu121 

verification

python
import torch
x = torch.rand(5, 3)
print(x)

check if GPU driver and CUDA are enabled and accessible by PyTorch

>>> torch.cuda.is_available()
True

  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值