Window 10 install Pytorch with CUDA

This tutorical contains content abouts how to set up Pytorch environment in a PC with CUDA.

Three parts are included in this turtorial when installing Pytorch.

Reference: https://pytorch.org/get-started/locally/

 

Part 1: Install Python using Anaconda

Anaconda : Downloaded from https://www.anaconda.com/products/individual#windowsand follow the instruction.

Click on the installer link and select Run. Anaconda will download and the installer prompt will be presented to you. The default options are generally sane.

Part 2: Install Pytorch

Use anaconda prompt to install.

Open https://developer.nvidia.com/zh-cn/cuda-zone choose OS: Windows, Package: Conda and the CUDA version suited to your machine. Then, run the command that is presented to you.

Part 2: Verification

Open command line  and input the following.

python

then enter the following code:

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

The output should be something similar to:

tensor([[0.3380, 0.3845, 0.3217],
        [0.8337, 0.9050, 0.2650],
        [0.2979, 0.7141, 0.9069],
        [0.1449, 0.1132, 0.1375],
        [0.4675, 0.3947, 0.1426]])
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值