This repo takes advantage of two frameworks: (1) Hydra for configs management and (2) Pytorch Lightning for improving our lives when colaborating and running experiments on different hardware.
The particular approach of this repo is heavily inspired by [https://youtu.be/w10WrRA-6uI].
On HPC:
- Create a virtual environment the way you are used to (conda, venv, pyenv, whatever).
The intended approach is to use
venv. Ifcondaor other virtual environment frameworks are used, the scripts in/bash/folder cannot be used but are easily modified. (1 line modification).
It's very important that you load a new-ish python version before running the getting started script. Do this by:
module load python3/3.10
module load cuda/11.7
- Set environment variable:
export PATH_TO_VENV=#path to your venv
- Run the bash script from the root folder:
./bash/setup.sh
This will:
- Load the HPC modules mentioned above
- Activate the virtual environment
- Install the package in editable mode with all requirements
You should further install the requirements for developing (writing code) of the package:
pip install -r requirements-dev.txt
This repo has protection on the main branch. Therefore any contribution has to go through a Pull Request.
The package logs relevant metrics and stats to wandb. For this to run, one needs to login with a token:
wandb login your_token
After which we can tain on GPU:
python3 ./scripts/train.py trainer.accelerator=gpu
Or cpu:
python3 ./scripts/train.py
python3 scripts/train.py -cn config_hotdog_training trainer.accelerator=gpu model=resnet18_transfer model.params.num_classes=1 metric.metric.params.task=binary general.run_name=xxxxxxx
python3 scripts/train.py -cn config_ph2_training trainer.accelerator=gpu general.run_name=xxxxxxx general.project_name=project2 model=unet