Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channel Pruning for SSD #228

Merged
merged 15 commits into from
Feb 18, 2019
Merged

Channel Pruning for SSD #228

merged 15 commits into from
Feb 18, 2019

Conversation

jiaxiang-wu
Copy link
Contributor

In this PR, we have updated the implementation of ChannelPrunedRmtLearner so that it is now capable of compression SSD models. Below is the detailed results:

Model: SSD-VGG-16
Uncompressed model's mAP: 77.64%

Pruned Layers Prune Ratio FLOPs mAP
Backbone-only 0.2 67.34% 77.43%
Backbone-only 0.3 53.58% 77.05%
Backbone-only 0.4 41.63% 75.47%
Backbone-only 0.5 31.56% 73.29%
All layers 0.2 66.50% 76.98%
All layers 0.3 52.32% 76.42%
All layers 0.4 39.96% 74.89%
All layers 0.5 29.47% 72.48%

Usage:

# backbone-only
$ ./scripts/run_docker.sh nets/vgg_at_pascalvoc_run.py -n=4 \
    --learner=chn-pruned-rmt \
    --cpr_prune_ratio=0.2 \
    --batch_size=8

# all layers
$ ./scripts/run_docker.sh nets/vgg_at_pascalvoc_run.py -n=4 \
    --learner=chn-pruned-rmt \
    --cpr_prune_ratio=0.2 \
    --batch_size=8 \
    --cpr_skip_op_names=multibox_head

P.S.: A minor update to utils/get_idle_gpus.py. It now returns top-k GPUs with least memory occupation.

@CoderGenJ
Copy link

运行环境:
(1)运行指令:./scripts/run_local.sh nets/vgg_at_pascalvoc_run.py -n=4
--learner=chn-pruned-rmt
--cpr_prune_ratio=0.2
--batch_size=8
--cpr_skip_op_names=multibox_head
(2)运行环境:将ssd vgg16.ckpt(官方提供百度云盘)放入了./models文件中,运行之后出现
NotFoundError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Key model/ssd300/additional_layers/conv10/conv10_1/bias not found in checkpoint
[[node model/save/RestoreV2 (defined at /home/Eric/work_space/model_pruning/PocketFlow/learners/channel_pruning_rmt/learner.py:358) = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_model/save/Const_0_0, model/save/RestoreV2/tensor_names, model/save/RestoreV2/shape_and_slices)]]

但是在graph.pbtxt中找到了相关节点
请问如何解决?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants