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

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay