Giter VIP home page Giter VIP logo

dnn-pruning's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dnn-pruning's Issues

axis_index error

Vgg‘s prototxt and caffemodel was used to run this code , but it unfortunately occured this error--

Check failed: axis_index < num_axes() (1 vs. 1) axis 1 out of range for 1-D Blob with shape 100 (100)

vgg-cifar.caffemodel missing

Hello! Thank you very much for your good implementation! Could you please tell me how can I download the weight file?

Filter Pruning Error

Hi
When I started pruning resnet,appeared an error:

 Filter Pruning 

operating: conv = conv1 , convnext = res2a_branch1, bn = bn_conv1, dc = 32
Traceback (most recent call last):
File "filter_pruning_demo.py", line 748, in
prune_me = pruneLayer(prune_me, conv, convnext, bn, affine, dc)
File "filter_pruning_demo.py", line 139, in pruneLayer
net.WPQ[(conv_P,1)] = net.param_b_data(conv)
File "/home/cll/DNN-Pruning-master/lib/net.py", line 221, in param_b_data
return self.param_b(name).data
File "/home/cll/DNN-Pruning-master/lib/net.py", line 215, in param_b
return self.param(name)[1]
IndexError: Index out of range

pruning accuracy problem

hello,thanks for your code. but i have some problems in it.I let the entire network not pruning, let prune_mode = true ,but the re-saved model is only 10% accurate.
Ground-truth accuracy: top1 0.860 , top5 acc 0.987
Pruned model accuracy: (no fine-tune): top1 0.106 , top5 acc 0.525
this is my setting:
c.dcdic = {'conv1_1': 32,
'conv1_2': 64,
'conv2_1': 128,
'conv2_2': 128,
'conv3_1': 256,
'conv3_2': 256,
'conv3_3': 256,
'conv4_1': 512,
'conv4_2': 512,
'conv4_3': 512,
'conv5_1': 512,
'conv5_2': 512,
'conv5_3': 512}
please help me, thank for you.

Check failed: axis_index < num_axes() (1 vs. 1) axis 1 out of range for 1-D Blob with shape 1 (1)

The caffe report this error when I use this command:
python3 filter_pruning_demo.py -model ./temp/model.prototxt -weights ./temp/1.caffemodel
or
python3 filter_pruning_demo.py -model ./temp/model.prototxt
How to solve this problem?Thank you!

--- saveModel ---
in pt (new_pt): ./temp/renamed_model.prototxt
in model: ./temp/1.caffemodel
in WPQ: dict_keys([('conv4_1_P', 1), ('conv5_2_P', 1), 'conv3_1_scale_P', ('conv4_2_P', 1), 'conv3_2_bn_P', 'conv5_1_bn_P', 'conv5_1_scale_P', 'fc_P', 'conv4_3_bn_P', 'conv3_1_bn_P', ('conv5_1_P', 0), ('conv3_1_P', 1), 'conv4_2_scale_P', ('conv4_1_P', 0), 'conv5_3_scale_P', 'conv2_2_scale_P', ('conv4_2_P', 0), 'conv2_2_bn_P', 'conv2_1_scale_P', ('conv1_1_P', 0), ('conv3_1_P', 0), ('conv3_3_P', 1), 'conv4_1_scale_P', 'conv2_1_bn_P', ('conv3_2_P', 0), ('conv1_2_P', 0), ('conv2_2_P', 1), 'conv4_2_bn_P', ('conv2_2_P', 0), 'conv3_3_bn_P', 'conv1_1_bn_P', ('conv2_1_P', 0), ('conv5_3_P', 0), ('conv1_1_P', 1), ('conv4_3_P', 0), 'conv4_3_scale_P', ('conv3_3_P', 0), 'conv1_1_scale_P', ('conv1_2_P', 1), 'conv3_3_scale_P', 'conv1_2_scale_P', ('conv5_1_P', 1), 'conv3_2_scale_P', 'conv4_1_bn_P', ('conv5_2_P', 0), ('conv2_1_P', 1), 'conv5_2_scale_P', ('conv3_2_P', 1), ('conv4_3_P', 1), 'conv5_2_bn_P', 'conv5_3_bn_P', ('conv5_3_P', 1), 'conv1_2_bn_P'])
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0419 17:33:12.103587 1048 blob.hpp:122] Check failed: axis_index < num_axes() (1 vs. 1) axis 1 out of range for 1-D Blob with shape 1 (1)
*** Check failure stack trace: ***

How to pruning the residual block without the 1x1 conv projection shortcut?

Hi, @slothkong

I encountered some troubles when I try to prune filters for ResNet.

In the paper "Pruning Filters for Efficient ConvNets", the author has shown how to prune a residual block with a 1x1 conv projection shortcut, which is logical and reasonable; However, I cannot figure out how to efficiently prune a residual block without that 1x1 conv projection shortcut. It should note that most residual blocks in the ResNet have no 1x1 conv projection shortcut, i.e., their shortcuts contain no parameters. If we prune filters of both conv layers in such a residual block, the channels of the residual branch and the main branch might be different, and thus F(x) and the residual x cannot be added directly. I wonder how you slove this problem in your implemtation, and any suggestions/advices will be greatly appreciated!

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.