Home

Awesome

PyTorch models trained on CIFAR-10 dataset

Statistics of supported models

No.ModelVal. Acc.No. ParamsSize
1vgg11_bn92.39%28.150 M108 MB
2vgg13_bn94.22%28.334 M109 MB
3vgg16_bn94.00%33.647 M129 MB
4vgg19_bn93.95%38.959 M149 MB
5resnet1893.07%11.174 M43 MB
6resnet3493.34%21.282 M82 MB
7resnet5093.65%23.521 M91 MB
8densenet12194.06%6.956 M28 MB
9densenet16194.07%26.483 M103 MB
10densenet16994.05%12.493 M49 MB
11mobilenet_v293.91%2.237 M9 MB
12googlenet92.85%5.491 M22 MB
13inception_v393.74%21.640 M83 MB

Details Report & Run Logs

Weight and Biases' details report for this project WandB Report

Weight and Biases' run logs for this project WandB Run Log. You can see each run hyper-parameters, training accuracy, validation accuracy, loss, time taken.

How To Cite

DOI

How to use pretrained models

Automatically download and extract the weights from Box (933 MB)

python train.py --download_weights 1

Or use Google Drive backup link (you have to download and extract manually)

Load model and run

from cifar10_models.vgg import vgg11_bn, vgg13_bn, vgg16_bn, vgg19_bn

# Untrained model
my_model = vgg11_bn()

# Pretrained model
my_model = vgg11_bn(pretrained=True)
my_model.eval() # for evaluation

If you use your own images, all models expect data to be in range [0, 1] then normalized by

mean = [0.4914, 0.4822, 0.4465]
std = [0.2471, 0.2435, 0.2616]

How to train models from scratch

Check the train.py to see all available hyper-parameter choices. To reproduce the same accuracy use the default hyper-parameters

python train.py --classifier resnet18

How to test pretrained models

python train.py --test_phase 1 --pretrained 1 --classifier resnet18

Output

{'acc/test': tensor(93.0689, device='cuda:0')}

Requirements

Just to use pretrained models

To train & test