VOOZH about

URL: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-pytorch

⇱ How To Install and Use PyTorch | DigitalOcean


How To Install and Use PyTorch

Published on February 11, 2021

By Alvin Wan

AI PhD Student @ UC Berkeley

👁 How To Install and Use PyTorch

The author selected the International Medical Corps to receive a donation as part of the Write for DOnations program.

Introduction

PyTorch is a framework developed by Facebook AI Research for deep learning, featuring both beginner-friendly debugging tools and a high-level of customization for advanced users, with researchers and practitioners using it across companies like Facebook and Tesla. Applications include computer vision, natural language processing, cryptography, and more. Whereas more advanced DigitalOcean articles, like Introduction to PyTorch, discuss how PyTorch works and what you can build with PyTorch, this tutorial will focus on installing PyTorch.

In this tutorial, you’ll install PyTorch’s “CPU support only” version in three steps. This installation is ideal for people looking to install and use PyTorch but who don’t have an Nvidia graphics card. In particular, you’ll install PyTorch in a Python virtual environment with virtualenv. This approach isolates the PyTorch installation, allowing you to install different PyTorch versions for each project. Once you complete the installation, you’ll validate your installation by running a short PyTorch program and then use PyTorch to perform image classification.

While you won’t need prior experience in practical deep learning or PyTorch to follow along with this tutorial, we’ll assume some familiarity with machine learning terms and concepts such as tensors. You can learn more about these concepts in An Introduction to Machine Learning.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author

👁 Alvin Wan
Alvin Wan
Author
AI PhD Student @ UC Berkeley
See author profile

I'm a diglot by definition, lactose intolerant by birth but an ice-cream lover at heart. Call me wabbly, witling, whatever you will, but I go by Alvin

Still looking for an answer?

Was this helpful?

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

👁 Creative Commons
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
  • Deploy on DigitalOcean

    Click below to sign up for DigitalOcean's virtual machines, Databases, and AIML products.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and AI-native businesses

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

© 2026 DigitalOcean, LLC.Sitemap.
Dark mode is coming soon.