Zoobot can be installed directly from PyPI for most users, or from source if you plan to modify the library itself. GPU support requires a compatible CUDA installation, but Zoobot also runs correctly on CPU — training is simply slower. Python 3.9 or higher is required.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mwalmsley/zoobot/llms.txt
Use this file to discover all available pages before exploring further.
Installation Methods
Choose your install method
Pick the method that best fits your workflow:
- PyPI — installs the latest stable release. Best for most users who won’t be modifying Zoobot itself.
- From source (editable mode) — clones the repository and installs it in editable mode so that local changes to the source are immediately reflected without reinstalling.
- Google Colab — uses the
pytorch_colabextra, which only installs Lightning and avoids reinstalling PyTorch packages that Colab already provides (which can cause conflicts).
Google Colab users must use
pip install zoobot[pytorch_colab] rather than pip install zoobot[pytorch]. Reinstalling PyTorch inside Colab can break the runtime environment.(Optional) Set up GPU / CUDA support
If you have an NVIDIA GPU, installing CUDA dramatically speeds up training. Zoobot is tested against CUDA 12.8 with PyTorch 2.7.0.We strongly recommend using conda (or Then install Zoobot inside the activated environment:
mamba, which is faster) to manage CUDA installation alongside your Python environment:CUDA is entirely optional. Zoobot runs fine on CPU — it is just slower. For experimentation or small datasets, CPU is perfectly adequate.
Verify the installation
Confirm that Zoobot and its finetuning module are importable:If this runs without errors, you are ready to go. See the Quickstart to finetune your first model.
Python and Dependency Requirements
Zoobot requires Python ≥ 3.9. Thezoobot[pytorch] extra pulls in the following key dependencies:
| Package | Minimum version | Purpose |
|---|---|---|
torch | ≥ 2.7.0 | Core deep learning framework |
torchvision | latest | Image transforms and datasets |
lightning | ≥ 2.2.5 | Training loop, checkpointing, early stopping |
timm | ≥ 1.0.15 | Pretrained encoder architectures (ConvNeXT, MaxViT, EfficientNet, ResNet) |
galaxy-datasets | ≥ 0.0.25 | CatalogDataModule and galaxy-specific data utilities |
huggingface_hub | latest | Auto-downloading pretrained encoders from HuggingFace |
h5py | latest | Reading HDF5 image files |
pandas | latest | Catalog management |
numpy | latest | Numerical operations |
astropy | latest | Reading FITS image files |
scikit-learn | ≥ 1.0.2 | Linear sanity-check evaluation |
wandb | latest | Optional experiment tracking (Weights & Biases) |
Common Install Issues
torch version not found: 'Could not find a version that satisfies the requirement torch==x.x.x+cuXXX'
torch version not found: 'Could not find a version that satisfies the requirement torch==x.x.x+cuXXX'
Certain CUDA-specific PyTorch builds (e.g. Consult the PyTorch previous versions page to find the exact command for your CUDA version. With Zoobot 2.0 and
torch==1.12.1+cu113) are not available from pip’s default package index. You need to point pip at the PyTorch package index using the --extra-index-url flag.For example, for CUDA 11.3:pip install zoobot[pytorch], this is typically no longer necessary as PyTorch 2.7.0+ supports CUDA 12.8 through the conda method above.GPU not detected after installation
GPU not detected after installation
Verify that PyTorch can see your GPU:If
torch.cuda.is_available() returns False:- Confirm CUDA is installed:
nvcc --versionornvidia-smiin your terminal. - Check that your CUDA version matches what PyTorch expects. CUDA 12.8 is required for PyTorch 2.7.0.
- If you installed PyTorch before CUDA, reinstall into a fresh conda environment following the GPU setup steps above.
ImportError or ModuleNotFoundError after install
ImportError or ModuleNotFoundError after install
If you see an import error immediately after installation, the most common causes are:
- Wrong environment — make sure the environment where you installed Zoobot is the one your Python session is using. Run
which python(Linux/macOS) orwhere python(Windows) to confirm. - Editable install not reflecting changes — if you installed from source with
-eand are seeing old code, try restarting your Python kernel. - Conflicting versions in Colab — use
pip install zoobot[pytorch_colab], not the fullpytorchextra, to avoid overwriting Colab’s pre-installed packages.
timm compatibility: 'previously downloaded checkpoints may not load correctly'
timm compatibility: 'previously downloaded checkpoints may not load correctly'
Zoobot 2.0 updated
timm to ≥ 1.0.15. Checkpoints saved with older Zoobot versions (which used timm 0.9.x) may not load cleanly with the current version. If you need to load old checkpoints, pin timm to the version used when the checkpoint was saved, or re-export the encoder weights using the old environment before upgrading.Out-of-memory (OOM) error during training
Out-of-memory (OOM) error during training
If training crashes with a CUDA out-of-memory error, try reducing the batch size in your For very limited GPU memory, consider using a smaller encoder (e.g.
CatalogDataModule:convnext_nano instead of convnext_base) or setting training_mode='head_only' to freeze the encoder and only train the classification head.