A primary project structure for pytorch work.
-
Install cookiecutter
pip install cookiecutter
-
Create project based on template
- Use GitHub URL directly.
cookiecutter https://github.com/daniel-code/pytorch-project-template.git
- Download template, and use it locally.
cookiecutter pytorch-project-template
Install development dependencies. There are some optional dependencies, like pytorch, pytorch-lightning, mlflow.
pip install -r requirements-dev.txt
Some test cases only passed in Linux.
cd tests
pytest
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