Python Engineer

Free Python and Machine Learning Tutorials

Become A Patron and get exclusive content! Get access to ML From Scratch notebooks, join a private Slack channel, get priority response, and more! I really appreciate the support!

back to course overview

Installation - PyTorch Beginner 01

13 Dec 2019

New Tutorial series about PyTorch! Learn all the basics you need to get started with this deep learning framework! In this first part I show you how I install PyTorch on my Mac using Anaconda. Installation on Linux or Windows can be done almost the same way.

All code from this course can be found on GitHub.

Go to https://pytorch.org/get-started/locally/

select OS: Mac select Package: conda select Python 3.7 if Linux or Windows and want GPU support --> >select Cuda version 10.1

Install Cuda Toolkit (If you want GPU support)

Development environment for creating high performance GPU-accelerated applications You need an NVIDIA GPU in your machine:

https://developer.nvidia.com/cuda-downloads

Legacy releases 10.1 update 2 --> select OS (e.g. Windows 10) --> Download and install

Create conda environment and activate it

conda create -n pytorch python=3.7 conda activate pytorch

Install pytorch

conda install pytorch torchvision -c pytorch

or with GPU

conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

Verification

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