Install¶
Extras¶
Nothing optional is installed by default, and nothing optional is imported unless you ask for it:
training with logger_name = ["text"] never imports wandb.
| Extra | Pulls in | For |
|---|---|---|
| (none) | torch, pytorch-ignite, ml_collections, numpy, tqdm | training |
wandb |
wandb |
W&B logging |
discord |
requests |
Discord webhook notifications |
examples |
torchvision |
the MNIST example |
dev |
pytest, pytest-cov, ruff |
running the test suite and the linter |
docs |
mkdocs-material, mkdocstrings, mkdocs-gen-files | building this site |
Requirements¶
- Python ≥ 3.9
- torch ≥ 2.4
- pytorch-ignite ≥ 0.4.13, < 0.6. Both 0.4 and 0.5 work, so this installs into an existing 0.4.13 environment with no upgrade.
A fresh install needs none of the care below: pip takes the newest torch and the newest numpy, and they agree. The pairings only matter when you hold a dependency back, which with torch is common.
Holding torch back? Hold numpy back too.
numpy 2.0 was an ABI break. A torch built against numpy 1.x cannot use numpy 2 arrays, and the
failure arrives late: an import-time UserWarning, then a RuntimeError on the first .numpy()
call, often deep inside a metric:
pip will not catch this. torch declares no numpy bound, so pip installs the broken pair without complaint, and this package's metadata cannot say "numpy < 2, but only with an older torch". torch 2.4.1 with numpy 2 has been checked and works. If you pin a torch built against numpy 1.x (a CUDA driver is the usual reason to pin), pin numpy with it:
torchvision decides which torch you get
torchvision pins the exact torch it was built against, so pip install ".[examples]" can move
torch under you. This package cannot express that pairing without pinning torch itself, which
would make it un-co-installable with anything wanting a different one. If you care which torch you
have, install it first and let torchvision resolve against it, or pin both together.
A GPU is optional. The synthetic example trains on CPU in seconds. With 0 or 1 GPU a run is a single process with no distributed backend, so the command does not change.