⚡ PyTorch Project Template
This repository is a codebase template for projects using PyTorch.
It includes an example project that performs multi-class classification on the MNIST dataset using ConvNet and ConvNet2(with residual connections).
✅ Planned for future release
If you have idea, let me know!
├── README.md
├── configs
│ ├── convnet2_mnist_cls.yaml
│ └── convnet_mnist_cls.yaml
├── data
│ └── MNIST
├── datasets
│ ├── __init__.py
│ └── mnist_dataset.py
├── logs
│ ├── convnet2_mnist_cls
│ └── convnet_mnist_cls
├── models
│ ├── ConvNet
│ ├── ConvNet2
│ └── __init__.py
├── requirements.txt
├── scripts
│ ├── test_convnet2_mnist_cls.sh
│ ├── test_convnet_mnist_cls.sh
│ ├── train_convnet_mnist_cls.sh
│ ├── train_convnet_mnist_cls_ddp.sh
│ └── train_convnet2_mnist_cls.sh
├── subtasks
│ ├── 01
│ └── README.md
├── test.py
├── train.py
└── utils
├── __init__.py
├── engine.py
├── distributed.py
├── metrics.py
└── save_ckpt.py
🔥 Installation, Environment Setup
git clone https://github.com/drawcodeboy/PyTorch-Project-Template.git
conda create -n template python=3.12
conda activate template
pip install -r requirements.txt
# Train (Check options wandb or resume)
bash scripts/train_convnet_mnist_cls.sh
bash scripts/train_convnet2_mnist_cls.sh
# Train with DDP (Check options wandb or resume)
# Set DDP-related arguments
bash scripts/train_convnet_mnist_cls_ddp.sh
# Test
bash scripts/test_convnet_mnist_cls.sh
bash scripts/test_convnet2_mnist_cls.sh
# Subtask (Configure task via SUBTASK variable in shell script)
bash scripts/subtask.sh