jjerry-k / pytorch_template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyTorch Template


지극히 개인적인 일반적인 구조의 CNN 전용 template

  • Classification, Segmentation 에 적합한(?) template

Directory

  • data

    • Dataset Name
      • train
      • validation
      • test
  • log

    • Experiment name
      • date
        • ...
  • model

    • loss.py
    • metric.py
    • model.py
  • trainer

    • dataloader.py
    • evaluation.py
    • training.py
  • utils

    • ckpt.py
    • log.py

Install Package

  • Using Package
    • torch==1.7.1
    • torchvision==0.8.2
    • torchaudio==0.7.2
# Create environment
conda create -y -n torch python=3.7
conda activate torch

# CPU mode
pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements.txt

# GPU mode
pip install --no-cache-dir torch torchvision torchaudio
pip install -r requirements.txt

Training Example

Classification

  1. Download example dataset
  2. Unzip dataset in data directory
  3. Edit config.yaml
  4. Execute command python train.py --config config.yaml

Segmentation

...ing

  1. Download example dataset

To Do List

  • Multi GPU
  • Inference code
  • Weights & Biases 연결?
  • Segmentation

About


Languages

Language:Python 100.0%