Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
syt2Public archive

About

pytorch implementation of several CNNs for image classification

Topics

Resources

Stars

17 stars

Watchers

0 watching

Forks

Latest commit

 

History

38 Commits

Folders and files

Repository files navigation

CNNs for image classification

Train CNNs for image classification from scratch.

I post several pretrained weights below.

Requirement

  • pytorch 1.4.0+
  • torchvision
  • tensorboard 1.14+
  • numpy
  • pyyaml
  • tqdm
  • pillow

Dataset

  • CIFAR-10
  • CIFAR-100
  • ImageNet 2012

Usage

  • Add configuration file under configs folder as follows
    • cuda: "all"  # if not specified, use cpu. or specified as "0", "0,1"
      model:
          arch: resnet
          depth: 50
      data:
          dataset: imagenet
          train_dir: /PATH/TO/ILSVRC/train
          val_dir: /PATH/TO/ILSVRC/val
          workers: 16
      training:
          runid: xxxx  # recommended specified during validation and testing
          epochs: 100
          batch_size: 256
          loss:
              name: 'label_smooth'
              smoothing: 0.1
          optimizer:
              name: 'sgd'
              lr: 0.1
              weight_decay: 0.0001
              momentum: 0.9
          lr_schedule:
              name: 'multi_step'
              milestones: [30,60,90]
              gamma: 0.1
          save_interval: 1
          resume: save_model.pkl
          best_model: best_model.pkl
      
  • run train.py, validate.py or test.py as follows
    • python train.py --config configs/aaaa.yml