Skip to content

skasai5296/pytorch_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PyTorch Project Template

Yet another template for PyTorch projects Highly customizable, modularized code

Requirements

  • Python 3
  • PyTorch
  • pyyaml, addict (for configuration)
  • wandb (for visualizing training runs)

Usage

Run cd src && python train.py for sample training. For custom use, modify the following files:

  • src/dataset.py ... for custom Dataset and collate function for DataLoader
  • src/model.py ... for custom Module
  • src/optimization.py ... for custom loss function and optimizer
  • src/evaluator.py ... for custom evaluator (used for validation)

Then, put in configurations (hyperparameters, ...) into cfg/hogehoge.yml Sample configuration file is in cfg/sample.yml

Use your own configuration file to train model

train.py --config path/to/configuration/file.yml

Resume training with configuration

train.py --config path/to/configuration/file.yml --resume

About

Template for PyTorch experiments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages