Install PyTorch on Window 10

Great news! PyTorch now is supporting Windows!

If you have a PC with suitable Nvidia graphics card and installed CUDA 9.0 and Anaconda, type the following commands;

conda install pytorch cuda90 -c pytorch
pip3 install torchvision

It is about 500 MB, so be patient!

Screen Shot 2018-04-29 at 21.44.50

Underline is the old post.

PyTorch is a deep learning framework that puts Python first. Currently, it only supports MacOS or Linux.Capture1

But, can we use it on WIN10 without changing the system/computer?

Yes,  we can. 

The following source is from the Chinese ZhiHu forum PyTorch在64位Windows下的Conda包.

To install PyTorch, you will need the following requirements:

  • Anaconda3 x64 (with Python 3.5/3.6)
  • Windows 64 (Windows 7 or Windows Server 2008 above)
  • GPU needs CUDA  Packages (including the main bin files of CUDA 8 / 9)

Now, you can install the PyTorch by the following commands, choose the one that suits your PC.

# for CPU only packages
conda install -c peterjc123 pytorch-cpu

# for Windows 10 and Windows Server 2016, CUDA 8
conda install -c peterjc123 pytorch

# for Windows 10 and Windows Server 2016, CUDA 9
conda install -c peterjc123 pytorch cuda90

# for Windows 7/8/8.1 and Windows Server 2008/2012, CUDA 8
conda install -c peterjc123 pytorch_legacy

The following is my result:

29597375_1024055897753526_2730704557522992707_n

Use the following codes to test “cuda” and “cudnn”:

# CUDA TEST
import torch
x = torch.Tensor([1.0])
xx = x.cuda()
print(xx)

# CUDNN TEST
from torch.backends import cudnn
print(cudnn.is_acceptable(xx))

Capture

-END-

 

 

Author: Caihao (Chris) Cui

Digital Scientist & Advisory: Translating the modern machine learning, deep learning, and computer vision techniques into engineering and bringing ideas to life to design a better future.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s