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
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)