Adding resnext101 64x4d model by YosuaMichael · Pull Request #5935 · pytorch/vision (original) (raw)

Resolve #3485

Training and Validation script

We train the model using the following script:

python -u ~/script/run_with_submitit.py \
    --timeout 3000 --ngpus 8 --nodes 1 --batch-size=128 \
    --partition train --model resnext101_64x4d \
    --data-path="/datasets01_ontap/imagenet_full_size/061417" \
    --lr=0.5 --lr-scheduler=cosineannealinglr --lr-warmup-epochs=5 --lr-warmup-method=linear \
    --auto-augment=ta_wide --epochs=600 --random-erase=0.1 --weight-decay=0.00002 \
    --norm-weight-decay=0.0 --label-smoothing=0.1 --mixup-alpha=0.2 --cutmix-alpha=1.0 \
    --train-crop-size=176 --model-ema --val-resize-size=232 --ra-sampler --ra-reps=4

From the training, we found the best result is on epoch 455 with the EMA model.
We validate with the 1 gpu and batch_size==1 using the following script (with final output):

python -u ~/script/run_with_submitit.py \
    --timeout 3000 --nodes 1 --ngpus 1 --batch-size=1 \
    --partition train --model "resnext101_64x4d" \
    --data-path="/datasets01_ontap/imagenet_full_size/061417" \
    --weights="ResNeXt101_64X4D_Weights.IMAGENET1K_V1" \
    --test-only
# Acc@1 83.246 Acc@5 96.454

Quantized model

We do quantize the model by using the following script:

python train_quantization.py \
    --device='cpu' --post-training-quantize --backend='fbgemm' \
    --model=resnext101_64x4d --weights="ResNeXt101_64X4D_Weights.IMAGENET1K_V1" \
    --train-crop-size 176 --val-resize-size 232 --data-path /datasets01_ontap/imagenet_full_size/061417/

And from the result we validate it again using 1 gpu and batch_size=1 with the following script:

python train_quantization.py --device='cpu' --eval-batch-size=1 --test-only --backend='fbgemm' \
    --model='resnext101_64x4d'  --data-path="/datasets01_ontap/imagenet_full_size/061417" \
    --weights="ResNeXt101_64X4D_QuantizedWeights.IMAGENET1K_FBGEMM_V1"
# Acc@1 82.898 Acc@5 96.326