jihoonerd / tutorial-diffusion-models

Integration of OpenAI Diffusion model and Pytorch Lightning with Hydra

Repository from Github https://github.comjihoonerd/tutorial-diffusion-modelsRepository from Github https://github.comjihoonerd/tutorial-diffusion-models

Tutorial for Diffusion Models

PyTorch Lightning Config: Hydra Template

Description

Tutorial code to run diffusion models with pytorch-lightning and hydra template.

How to run

Install dependencies

# clone project
git clone https://github.com/jihoonerd/tutorial-diffusion-models
cd tutorial-diffusion-models

# [OPTIONAL] create conda environment
conda create -n myenv python=3.8
conda activate myenv

# install pytorch according to instructions
# https://pytorch.org/get-started/

# install requirements
pip install -r requirements.txt

Train model with default configuration

# train on CPU
python train.py trainer.gpus=0

# train on GPU
python train.py trainer.gpus=1

Train model with chosen experiment configuration from configs/experiment/

python train.py experiment=experiment_name.yaml

You can override any parameter from command line like this

python train.py trainer.max_epochs=20 datamodule.batch_size=64

About

Integration of OpenAI Diffusion model and Pytorch Lightning with Hydra


Languages

Language:Python 99.3%Language:Shell 0.7%