DEV Community

Full Stack Hacker
Full Stack Hacker

Posted on • Edited on

14 1

Install PyTorch on Debian

Install Python package manager

Pip is the native Python package manager. We will use it to install PyTorch and torchvision. To install pip3, run the following command. Because pip3 depends on Python 3, python3 will also be installed if it is not in your Debian system.

sudo apt install python3-pip

Installing PyTorch

pip3 install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

The above command was used to install PyTorch in the system that didn’t have GPU. You just copy the command and paste it into the terminal and run it.

The below command is used to install PyTorch on a system which has GPU. Make sure you have python 3.7 or higher.

pip3 install torch torchvision torchaudio

To make sure PyTorch is installed in your system, just type python3 in your terminal and run it. After that type import torch for use PyTorch library at last type and run print(torch.version) it shows which version of PyTorch was installed on your system if PyTorch was installed on your system.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay