From 517605a8646ea88dcd8c68abaf0fcd857236dc47 Mon Sep 17 00:00:00 2001 From: lijianshe02 <48898730+lijianshe02@users.noreply.github.com> Date: Thu, 23 Apr 2020 20:43:57 +0800 Subject: [PATCH] add fpgm pruning scripts for ResNet34, MobileNetV1, MobileNetV2 test=develop (#240) --- demo/prune/fpgm_mobilenetv1_f-50_train.sh | 17 +++++++++++++++++ demo/prune/fpgm_mobilenetv2_f-50_train.sh | 17 +++++++++++++++++ demo/prune/fpgm_resnet34_f-42_train.sh | 12 ++++++++++++ demo/prune/fpgm_resnet34_f-50_train.sh | 17 +++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 demo/prune/fpgm_mobilenetv1_f-50_train.sh create mode 100644 demo/prune/fpgm_mobilenetv2_f-50_train.sh create mode 100644 demo/prune/fpgm_resnet34_f-42_train.sh create mode 100644 demo/prune/fpgm_resnet34_f-50_train.sh diff --git a/demo/prune/fpgm_mobilenetv1_f-50_train.sh b/demo/prune/fpgm_mobilenetv1_f-50_train.sh new file mode 100644 index 0000000000000..0e84dafd5e961 --- /dev/null +++ b/demo/prune/fpgm_mobilenetv1_f-50_train.sh @@ -0,0 +1,17 @@ +#!/bin/bash +export CUDA_VISIBLE_DEVICES=0,1 +export FLAGS_fraction_of_gpu_memory_to_use=0.98 +python train.py \ + --model="MobileNet" \ + --pretrained_model="/workspace/models/MobileNetV1_pretrained" \ + --data="imagenet" \ + --pruned_ratio=0.3125 \ + --lr=0.1 \ + --num_epochs=120 \ + --test_period=10 \ + --step_epochs 30 60 90\ + --l2_decay=3e-5 \ + --lr_strategy="piecewise_decay" \ + --criterion="geometry_median" \ + --model_path="./fpgm_mobilenetv1_models" \ + 2>&1 | tee fpgm_mobilenetv1_train.log diff --git a/demo/prune/fpgm_mobilenetv2_f-50_train.sh b/demo/prune/fpgm_mobilenetv2_f-50_train.sh new file mode 100644 index 0000000000000..7d0399775f41f --- /dev/null +++ b/demo/prune/fpgm_mobilenetv2_f-50_train.sh @@ -0,0 +1,17 @@ +#!/bin/bash +export CUDA_VISIBLE_DEVICES=0,1 +export FLAGS_fraction_of_gpu_memory_to_use=0.98 +python train.py \ + --model="MobileNetV2" \ + --pretrained_model="/workspace/models/MobileNetV2_pretrained" \ + --data="imagenet" \ + --pruned_ratio=0.325 \ + --lr=0.001 \ + --num_epochs=90 \ + --test_period=5 \ + --step_epochs 30 60 80\ + --l2_decay=1e-4 \ + --lr_strategy="piecewise_decay" \ + --criterion="geometry_median" \ + --model_path="./fpgm_mobilenetv2_models" \ + 2>&1 | tee fpgm_mobilenetv2_train.log diff --git a/demo/prune/fpgm_resnet34_f-42_train.sh b/demo/prune/fpgm_resnet34_f-42_train.sh new file mode 100644 index 0000000000000..ec24c4d8f13ab --- /dev/null +++ b/demo/prune/fpgm_resnet34_f-42_train.sh @@ -0,0 +1,12 @@ +#!/bin/bash +export CUDA_VISIBLE_DEVICES=0,1,2,3 +export FLAGS_fraction_of_gpu_memory_to_use=0.98 +python train.py \ + --model="ResNet34" \ + --pretrained_model="/workspace/models/ResNet34_pretrained" \ + --data="imagenet" \ + --pruned_ratio=0.25 \ + --lr_strategy="cosine_decay" \ + --criterion="geometry_median" \ + --model_path="./fpgm_resnet34_025_120_models" \ + 2>&1 | tee fpgm_resnet025_120_train.log diff --git a/demo/prune/fpgm_resnet34_f-50_train.sh b/demo/prune/fpgm_resnet34_f-50_train.sh new file mode 100644 index 0000000000000..c181dfb66a1b0 --- /dev/null +++ b/demo/prune/fpgm_resnet34_f-50_train.sh @@ -0,0 +1,17 @@ +#!/bin/bash +export CUDA_VISIBLE_DEVICES=0,1 +export FLAGS_fraction_of_gpu_memory_to_use=0.98 +python train.py \ + --model="ResNet34" \ + --pretrained_model="/workspace/models/ResNet34_pretrained" \ + --data="imagenet" \ + --pruned_ratio=0.3125 \ + --lr=0.001 \ + --num_epochs=70 \ + --test_period=5 \ + --step_epochs 30 60 \ + --l2_decay=1e-4 \ + --lr_strategy="piecewise_decay" \ + --criterion="geometry_median" \ + --model_path="./fpgm_resnet34_models" \ + 2>&1 | tee fpgm_resnet03_train.log