Frequently Asked Questions
General
What is Lighter?
A configuration-driven deep learning framework built on PyTorch Lightning. Define experiments in YAML instead of writing training code.
How does Lighter compare to PyTorch Lightning?
Lighter uses PyTorch Lightning's Trainer but adds configuration-driven experiments. Define everything in YAML instead of LightningModule classes, with even more boilerplate taken care of for you. See Migration Guide.
When should I use Lighter?
- Running many experiments with different configurations
- Reproducibility and experiment tracking are priorities
- You prefer configuration over code
- You want a lightweight, flexible framework
Is Lighter only for medical imaging?
No! While it integrates with MONAI, Lighter works for any task: classification, detection, segmentation, NLP, self-supervised learning, etc.
Configuration
What's the difference between @, %, and $?
@= Reference to instantiated Python object%= Reference to YAML value (textual copy)$= Evaluate as Python expression
See Configuration Guide for details.
Can I use Python code in configs?
Yes! This is called evaluation—think eval() in Python. Use $ prefix:
Another example is passing model's parameters to the optimizer. To do this, you need to:
- Get the model definition via
system#model - Instantiate it using
@ - Evaluate its
.parameters()method using$
How do I debug config errors?
Training
How do I resume training?
How do I use multiple GPUs?
See PyTorch Lightning distributed docs.Why is my training slow?
Check:
- Increase
num_workersin dataloaders - Enable mixed precision (
--trainer#precision="16-mixed") - Use profiler (
--trainer#profiler="simple")
See PyTorch Lightning performance docs.
Troubleshooting
ModuleNotFoundError: No module named 'project'
Ensure:
- Project path is set correctly:
project: <PATH_TO_YOUR_PROJECT> - All module directories have
__init__.py