Mini-Tutorial: Installing PyTorch (CPU-only) on Ubuntu

Mini-Tutorial: Installing PyTorch (CPU-only) on Ubuntu

Last updated:
Table of Contents

:q!:q!

WIP Alert This is a work in progress. Current information is correct but more content may be added in the future.

Let's leave the full GPU/CUDA installation for later as it probably isn't fun

Setting up

  • Create a new virtualenv with Python-3 and add it to Jupyter as seen on Add Virtualenv as Python Kernel

  • Activate the virtualenv

  • Install the +cpu versions of dependencies like this

View the most up-to-date lib versions here: PyTorch Vision##Installation

  $ pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
  • You should see something like this in Jupyter:

    pytorch-cpu-only-on-jupyter Note the +cpu bit at the end