GitXplorerGitXplorer
h

pytorch-image-classification

public
1 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
074c6593a8d07dd838d4470c52be720581e5d428

fix: drop-last not recognizable bugs

hhankyul2 committed 2 years ago
Unverified
d965e7744bb37ef487ca1cdb89576a8d3073ee18

feat: support drop_last in train_loader

hhankyul2 committed 2 years ago
Unverified
2877766604aaf65e35678de2607db01f23893c38

fix: fixed ratio bugs

hhankyul2 committed 2 years ago
Unverified
9d38a3835b5d91572939dbf752c58cc4fdf43817

fix: cutmix ratio bugs

hhankyul2 committed 2 years ago
Unverified
b1a2d2d6d0be967446815d5bf88b8591e76b5e76

chore: update multi train hyperparameter

hhankyul2 committed 2 years ago
Unverified
3b74e06ac64980e9afd78df3eb99193a40b7f298

feat: support prefetcher in dataloading

hhankyul2 committed 3 years ago

README

The README file for this repository.

pytorch-image-classification

Pytorch Image Classification. This is just toy example for studying. Most code is ported from timm.

Tutorial

requirements: torch, torchvision, gdown

How to run this?

torchrun --nproc_per_node=2 train.py imageNet --cuda 7,8 
python3 train.py imageNet --cuda 7 
torchrun --nproc_per_node=2 multi_train.py tiny_a_25 tiny_a_50 cifar100_a_25 cifar100_a_50 cifar10_a_25 cifar10_a_50 -m resnext50_32_4 resnext101_32_4 -c 7,8 -o log/resnext

What does each variable mean?

  • nproc_per_node - control parallelism
  • cuda - control which gpu device to use

Need to remember

torchrun --nproc_per_node=2 train.py imageNet --interpolation bicubic --lr 1e-3 --epoch 50 --warmup-lr 1e-6 -j 8 --pin-memory --amp --channels-last --cuda 7,8 --who hankyul --exp-target model_name
  1. You should choose experiment_target or set experiment name manually.
  2. You should specify your name & project name
  3. resize operation in test time is done like this: (H, W) -> resize -> (test_size/crop_ptr, test_size/crop_ptr) -> center_crop -> (test_size, test_size). It makes me confused at first. But you can set test_image size directly.

Issue

  1. Validation scores are not same w/ w/o distributed mode. This is because len(dataset) % (batch_size * ngpu) != 0. Batch sizes for each gpu's last iter are different and averaging them together results in different validation score. Difference is about 0.04%.