PyTorch Lightning Project Setup
Project description
๐ Introduction
This repository contains a simple PyTorch Lightning + Hydra project template. It is designed to be a starting point for your own projects. It is based on the PyTorch Lightning.
๐ฆ Main Technologies
PyTorch Lightning - a lightweight PyTorch wrapper for high-performance AI research. Think of it as a framework for organizing your PyTorch code.
Hydra - a framework for elegantly configuring complex applications. The key feature is the ability to dynamically create a hierarchical configuration by composition and override it through config files and the command line.
๐ Project Structure
The directory structure of new project looks like this:
configs
โ โโโ data <- Data configs
configs
โ โโโ hydra <- Hydra configs
โ โโโ local <- Local configs
โ โโโ model <- Model configs
โ โโโ paths <- Project paths configs
โ โโโ trainer <- Trainer configs
โ โโโ eval.yaml <- Main config for evaluation
โ โโโ train.yaml <- Main config for training
โ
โโโ data <- Project data
โ
โโโ logs <- Logs generated by hydra and lightning loggers
โ
โโโ notebooks <- Jupyter notebooks. Naming convention is a number (for ordering),
โ the creator's initials, and a short `-`
โ
โโโ lightningtrain <- Source code
โ โโโ data <- Data scripts
โ โโโ models <- Model scripts
โ โโโ utils <- Utility scripts
โ โ
โ โโโ eval.py <- Run evaluation
โ โโโ train.py <- Run training
โ
โโโ tests <- Tests of any kind
โ
โโโ .gitignore <- List of files ignored by git
โโโ .project-root <- File for inferring the position of project root directory
โโโ Makefile <- Makefile with commands like `make train` or `make test`
โโโ pyproject.toml <- Configuration options for testing and linting
โโโ requirements.txt <- File for installing python dependencies
โโโ setup.py <- File for installing project as a package
โโโ README.md
๐ Quickstart
# clone project
git clone https://github.com/dlwizard/lightningflow.git
cd lightningflow
# create docker container with .devcontainer.json
# or install dependencies locally
# install project as a package
pip install -e .
# run training
lightningtrain_train data.num_workers=16
# run evaluation
lightningtrain_eval data.num_workers=16
๐ Docker container usage instructions
Prerequisites:
- Docker
- Visual Studio Code
- Remote - Containers extension
Steps:
- Clone this repository
- Open the repository in Visual Studio Code
- press crtl+shift+p and select "Remote-Containers: Reopen in Container"
- Wait for the container to build
- Open a terminal in Visual Studio Code and run the following commands:
# install project as a package
pip install -e .
# run training
lightningtrain_train data.num_workers=16
# run evaluation
lightningtrain_eval data.num_workers=16
๐ Instructions for PyPi package usage
Prerequisites:
Steps:
- python -m venv venv
- source venv\Scripts\activate
- python3 -m pip install lightningtrain
- lightningtrain_train data.num_workers=16
- lightningtrain_eval data.num_workers=16
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lightningtrain-0.0.4-py3-none-any.whl.
File metadata
- Download URL: lightningtrain-0.0.4-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e81bc4b1b23e44b12a5a57318276ec080a3937e460ab69a673b6ca6a216da92
|
|
| MD5 |
44378c70fee72dcc18267c60e76d0e58
|
|
| BLAKE2b-256 |
b9ba3f82fd4f5cb3d4c4b9fcb5c0ea812137eda8cd01e6c053ed825b6bed9e0c
|