Installation¶
pip install specsr-roman # inference + training
pip install "specsr-roman[hub]" # + published checkpoints and data
pip install "specsr-roman[extract]" # + dataset building
pip install "specsr-roman[all]" # everything
Python 3.10 or newer.
To track main instead of the last release:
pip install "specsr-roman[hub] @ git+https://github.com/aryana-haghjoo/specsr-roman"
Extras¶
Extra |
Pulls in |
Needed for |
|---|---|---|
(base) |
numpy, scipy, torch, astropy, matplotlib |
inference, training |
|
huggingface_hub |
fetching published checkpoints and data |
|
wandb |
metric syncing during training |
|
grizli, photutils, h5py, pyarrow |
building datasets from raw sims |
|
sphinx, furo, myst-parser |
building these pages |
|
pytest, ruff |
the test suite |
The extraction stack is heavy and only needed if you are re-extracting rather than downloading the released dataset. Everything else in the package works without it.
Checking an install¶
specsr-roman info
reports the version, whether CUDA is visible, which optional extras are present, and the canonical checkpoint names.
GPU¶
Training wants a GPU; inference on a handful of spectra is fine on CPU.
On Blackwell cards (RTX 50-series with CUDA 12.8) the fused attention kernels
return NaN in backward for SR2’s line-token transformer, so specsr-roman forces
the math SDPA backend during SR2 training. The transformer is 98 tokens wide,
so the cost is negligible.
Configuring paths¶
Data locations are environment-overridable and default to the working directory:
Variable |
Default |
What |
|---|---|---|
|
|
raw and prepared simulation products |
|
|
built training datasets |
|
|
checkpoints and predictions |
|
|
checkpoint source |
|
|
grizli |