![]() Co-authored-by: tchaton <thomas@grid.ai> |
||
---|---|---|
.. | ||
README.md | ||
__init__.py | ||
autoencoder.py | ||
backbone_image_classifier.py | ||
dali_image_classifier.py | ||
mnist_datamodule.py | ||
profiler_example.py | ||
simple_image_classifier.py |
README.md
Basic Examples
Use these examples to test how Lightning works.
MNIST
Trains MNIST where the model is defined inside the LightningModule
.
# cpu
python simple_image_classifier.py
# gpus (any number)
python simple_image_classifier.py --trainer.gpus 2
# Distributed Data Parallel
python simple_image_classifier.py --trainer.gpus 2 --trainer.accelerator ddp
MNIST with DALI
The MNIST example above using NVIDIA DALI. Requires NVIDIA DALI to be installed based on your CUDA version, see here.
python dali_image_classifier.py
Image classifier
Generic image classifier with an arbitrary backbone (ie: a simple system)
# cpu
python backbone_image_classifier.py
# gpus (any number)
python backbone_image_classifier.py --trainer.gpus 2
# Distributed Data Parallel
python backbone_image_classifier.py --trainer.gpus 2 --trainer.accelerator ddp
Autoencoder
Showing the power of a system... arbitrarily complex training loops
# cpu
python autoencoder.py
# gpus (any number)
python autoencoder.py --trainer.gpus 2
# Distributed Data Parallel
python autoencoder.py --trainer.gpus 2 --trainer.accelerator ddp