Skip to content

Commit

Permalink
add fpgm pruning scripts for ResNet34, MobileNetV1, MobileNetV2 test=…
Browse files Browse the repository at this point in the history
…develop (PaddlePaddle#240)
  • Loading branch information
lijianshe02 authored Apr 23, 2020
1 parent d7116aa commit 517605a
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
17 changes: 17 additions & 0 deletions demo/prune/fpgm_mobilenetv1_f-50_train.sh
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions demo/prune/fpgm_mobilenetv2_f-50_train.sh
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions demo/prune/fpgm_resnet34_f-42_train.sh
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions demo/prune/fpgm_resnet34_f-50_train.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 517605a

Please sign in to comment.