PyTorch is a popular open-source machine learning library. Here's how to install it across different platforms:
📦 Installation Methods
💻 Linux & macOS
# Using pip
pip3 install torch torchvision torchaudio
# Using conda
conda install pytorch torchvision torchaudio -c pytorch
📊 Windows
# With pip
pip install torch torchvision torchaudio
# With conda
conda install pytorch torchvision torchaudio -c pytorch
🧠 GPU Support
For CUDA-enabled installations:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
✅ Verify Installation
Run this command in your terminal:
python -c "import torch; print(torch.__version__)"
If successful, you'll see PyTorch's version number 🎉
📚 Extend Your Knowledge
Explore PyTorch tutorials to dive deeper into its capabilities after installation.