Skip to content

daniel-code/pytorch-project-template

Repository files navigation

Pytorch Project Template

A primary project structure for pytorch work.

Contents

  1. Usage
  2. Development
    1. Setup
    2. Test
  3. Acknowledgements

Usage

  1. Install cookiecutter

    pip install cookiecutter
    
  2. Create project based on template

    1. Use GitHub URL directly.
    cookiecutter https://github.com/daniel-code/pytorch-project-template.git
    
    1. Download template, and use it locally.
    cookiecutter pytorch-project-template
    

Development

Setup

Install development dependencies. There are some optional dependencies, like pytorch, pytorch-lightning, mlflow.

pip install -r requirements-dev.txt

Test

Some test cases only passed in Linux.

cd tests
pytest

Acknowledgements

This repository is based on drivendata/cookiecutter-data-science

Difference with the original repository

  • add yapf, python formatter, into project structure
  • add pre-commit for git hook
  • change folders name that all folder names are unique within the project
  • Pytorch wrapper pipeline and mlflow