pytorch-lightning

(★ 31,297)

Pretrain, finetune ANY AI model of ANY size on 1 or 10,000+ GPUs with zero code changes.

File Explorer

  • .codecov.yml
  • .git-blame-ignore-revs
  • .gitignore
  • .gitmodules
  • .pre-commit-config.yaml
  • .readthedocs.yml
  • _notebooks
  • CITATION.cff
  • LICENSE
  • Makefile
  • pyproject.toml
  • README.md
  • requirements.txt
  • SECURITY.md
  • setup.py

# Installation Guide

python
Prerequisites

Setup Steps

pip install lightning

Install the core library.

pip install lightning['extra']

Install the package with optional dependencies.

pip install torchvision

Install torchvision required for running examples.

python main.py

Run the training script.

Key Commands

pip install lightning

Install the core PyTorch Lightning package.

pip install lightning['extra']

Install with extra features and expansion modules.

python main.py

Run the training script to train the model.

Appropriate versions of PyTorch and CUDA must be pre-installed for GPU utilization.

# Use via CDN

jsDelivr

jsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.

Release Timeline

Actively Maintained

Command Glossary

Commands referenced in this DOCs, explained below.

🔍

conda install

View Details ▼

Install packages into an existing conda environment.

conda install {{package1 package2 ...}}

Install one or more package into the currently active conda environment:

conda install {{[-c|--channel]}} conda-forge {{package}}

Install a single package into the currently active conda environment using channel conda-forge:

conda install {{[-c|--channel]}} conda-forge --override-channels {{package}}

Install a single package into the currently active conda environment using channel conda-forge and ignoring other channels:

🔍

pip install

View Details ▼

Install Python packages.

pip install {{package1 package2 ...}}

Install one or more packages:

pip install {{package1 package2 ...}} {{[-U|--upgrade]}}

Upgrade all specified packages to the latest version, installing any that are not already present:

pip install {{package}}=={{version}}

Install a specific version of a package:

🔍

python

View Details ▼

Python language interpreter.

python

Start a REPL (interactive shell):

python {{path/to/file.py}}

Execute a specific Python file:

python -i {{path/to/file.py}}

Execute a specific Python file and start a REPL:

// repository documentation