]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - jacinto-ai/pytorch-jacinto-ai-devkit.git/blob - run_quantization.sh
release commit
[jacinto-ai/pytorch-jacinto-ai-devkit.git] / run_quantization.sh
1 # Quantization
3 ## =====================================================================================
4 ## Trained Quantization
5 ## =====================================================================================
6 #
7 #### Image Classification - Trained Quantization - MobileNetV2
8 #python ./scripts/train_classification_main.py --dataset_name image_folder_classification --model_name mobilenetv2_tv_x1 --data_path ./data/datasets/image_folder_classification \
9 #--pretrained https://download.pytorch.org/models/mobilenet_v2-b0353104.pth \
10 #--batch_size 64 --quantize True --epochs 25 --epoch_size 1000 --lr 5e-5 --evaluate_start False
11 #
12 #
13 #### Image Classification - Trained Quantization - MobileNetV2(Shicai) - a TOUGH MobileNetV2 pretrained model
14 #python ./scripts/train_classification_main.py --dataset_name image_folder_classification --model_name mobilenetv2_shicai_x1 --data_path ./data/datasets/image_folder_classification \
15 #--pretrained ./data/modelzoo/pretrained/pytorch/others/shicai/MobileNet-Caffe/mobilenetv2_shicai_rgb.tar \
16 #--batch_size 64 --quantize True --epochs 25 --epoch_size 1000 --lr 5e-5 --evaluate_start False
17 #
18 #
19 #### Semantic Segmentation - Trained Quantization for MobileNetV2+DeeplabV3Lite
20 #python ./scripts/train_segmentation_main.py --dataset_name cityscapes_segmentation --model_name deeplabv3lite_mobilenetv2_tv --data_path ./data/datasets/cityscapes/data --img_resize 384 768 --output_size 1024 2048 --gpus 0 1 \
21 #--pretrained ./data/modelzoo/semantic_segmentation/cityscapes/deeplabv3lite-mobilenetv2/cityscapes_segmentation_deeplabv3lite-mobilenetv2_2019-06-26-08-59-32.pth \
22 #--batch_size 12 --quantize True --epochs 150 --lr 5e-5 --evaluate_start False
25 ## =====================================================================================
26 ## Acuracy Evaluation with Post Training Quantization - cannot save quantized model - only accuracy evaluation
27 ## =====================================================================================
29 #### Image Classification - Accuracy Estimation with Post Training Quantization - MobileNetV2
30 #python ./scripts/train_classification_main.py --phase validation --dataset_name image_folder_classification --model_name mobilenetv2_tv_x1 --data_path ./data/datasets/image_folder_classification \
31 #--pretrained https://download.pytorch.org/models/mobilenet_v2-b0353104.pth \
32 #--batch_size 64 --quantize True
34 #### Image Classification - Accuracy Estimation with Post Training Quantization - ResNet50
35 #python ./scripts/train_classification_main.py --phase validation --dataset_name image_folder_classification --model_name resnet50_x1 --data_path ./data/datasets/image_folder_classification \
36 #--pretrained https://download.pytorch.org/models/resnet50-19c8e357.pth \
37 #--batch_size 64 --quantize True
39 #### Image Classification - Accuracy Estimation with Post Training Quantization - A TOUGH MobileNetV2 pretrained model
40 #python ./scripts/train_classification_main.py --phase validation --dataset_name image_folder_classification --model_name mobilenetv2_shicai_x1 --data_path ./data/datasets/image_folder_classification \
41 #--pretrained ./data/modelzoo/pretrained/pytorch/others/shicai/MobileNet-Caffe/mobilenetv2_shicai_rgb.tar \
42 #--batch_size 64 --quantize True
44 #### Semantic Segmentation - Accuracy Estimation with Post Training Quantization
45 #python ./scripts/train_segmentation_main.py --phase validation --dataset_name cityscapes_segmentation --model_name deeplabv3lite_mobilenetv2_tv --data_path ./data/datasets/cityscapes/data --img_resize 384 768 --output_size 1024 2048 --gpus 0 1 \
46 #--pretrained './data/modelzoo/semantic_segmentation/cityscapes/deeplabv3lite-mobilenetv2/cityscapes_segmentation_deeplabv3lite-mobilenetv2_2019-06-26-08-59-32.pth' \
47 #--batch_size 1 --quantize True
50 ## =====================================================================================
51 ## Post Training Calibration & Quantization - this is fast, but may not always yield best quantized accuracy (not recommended)
52 ## =====================================================================================
53 #
54 #### Image Classification - Post Training Calibration & Quantization - ResNet50
55 #python ./scripts/train_classification_main.py --phase calibration --dataset_name image_folder_classification --model_name resnet50_x1 --data_path ./data/datasets/image_folder_classification \
56 #--pretrained https://download.pytorch.org/models/resnet50-19c8e357.pth \
57 #--batch_size 64 --quantize True --epochs 1 --epoch_size 100
58 #
59 #
60 #### Image Classification - Post Training Calibration & Quantization - MobileNetV2
61 #python ./scripts/train_classification_main.py --phase calibration --dataset_name image_folder_classification --model_name mobilenetv2_tv_x1 --data_path ./data/datasets/image_folder_classification \
62 #--pretrained https://download.pytorch.org/models/mobilenet_v2-b0353104.pth \
63 #--batch_size 64 --quantize True --epochs 1 --epoch_size 100
64 #
65 #
66 #### Image Classification - Post Training Calibration & Quantization for a TOUGH MobileNetV2 pretrained model
67 #python ./scripts/train_classification_main.py --phase calibration --dataset_name image_folder_classification --model_name mobilenetv2_shicai_x1 --data_path ./data/datasets/image_folder_classification \
68 #--pretrained ./data/modelzoo/pretrained/pytorch/others/shicai/MobileNet-Caffe/mobilenetv2_shicai_rgb.tar \
69 #--batch_size 64 --quantize True --epochs 1 --epoch_size 100
70 #
71 #
72 #### Semantic Segmentation - Post Training Calibration &  Quantization for MobileNetV2+DeeplabV3Lite
73 #python ./scripts/train_segmentation_main.py --phase calibration --dataset_name cityscapes_segmentation --model_name deeplabv3lite_mobilenetv2_tv --data_path ./data/datasets/cityscapes/data --img_resize 384 768 --output_size 1024 2048 --gpus 0 1 \
74 #--pretrained ./data/modelzoo/semantic_segmentation/cityscapes/deeplabv3lite-mobilenetv2/cityscapes_segmentation_deeplabv3lite-mobilenetv2_2019-06-26-08-59-32.pth \
75 #--batch_size 12 --quantize True --epochs 1 --epoch_size 100