python-pytorchHow do I install PyTorch on Ubuntu using Python?
- Install the latest version of Python3 using
sudo apt install python3 - Install PyTorch using
pip3 install torch torchvision - Verify the installation by running the following code block:
import torch
print(torch.__version__)
Output example
1.5.1
- Install Jupyter Notebook using
pip3 install jupyter - Verify the installation by running the following code block:
import jupyter
print(jupyter.__version__)
Output example
1.0.0
- Create a virtual environment using
virtualenv -p python3 venv - Activate the virtual environment using
source venv/bin/activate
Helpful links
More of Python Pytorch
- What is the most compatible version of Python to use with PyTorch?
- How can I compare Python PyTorch and Torch for software development?
- How can I use Python Poetry to install PyTorch?
- How do I use the unsqueeze function in Python PyTorch?
- How can I use Python, PyTorch, and YOLOv5 to build an object detection model?
- How do Python, PyTorch, and TensorFlow differ in terms of software development?
- How do I create a Python PyTorch tutorial?
- How do I install PyTorch using pip?
- How do I uninstall Python PyTorch?
See more codes...