SCUT-AILab / DCP

Code for “Discrimination-aware-Channel-Pruning-for-Deep-Neural-Networks”
BSD 3-Clause "New" or "Revised" License
184 stars 27 forks source link

Training time too long #6

Open yuanze-lin opened 5 years ago

yuanze-lin commented 5 years ago

I'm trying to reproduce your experimental results on ImageNet, however I find that training resnet networks really takes super long time !!! So I want to know how much time did you use to train resnet on ImageNet dataset??? Thanks !!!

liujingcs commented 5 years ago

It takes about 2 days to prune the ResNet-18 with pruning rate of 0.7. It takes a bit long time. We will improve the efficiency of the algorithm soon.

yuanze-lin commented 5 years ago

Are you sure??? Then how do you set the epochs of block-wise and network-wise finetuning respectively??? (on ImageNet dataset)

liujingcs commented 5 years ago

This time does not contain network-wise finetuning. Network-wise finetuning takes about 1 day. We set 20 epochs in block-wise finetuning and 60 epochs in network-wise finetuning. To accelerate the pruning, you can set fewer epochs in block-wise finetuning.

yuanze-lin commented 5 years ago

I really appreciate for your patient reply. :)

liujingcs commented 5 years ago

It should be noted that we only use subset of imagenet. Therefore, you should set max_sample to 10000.

Caoliangjie commented 5 years ago

Thanks for your work. When I want to reproduct the channel pruning example, I found that in DCP/dcp/channel_selections/channel_selections.py line 294, grad_fnorm = cum_grad.mul(cum_grad).sum((2, 3)).sqrt().sum(0) ,some errors occured, it means the 'sum()' function is wrong used. I change it to grad_fnorm = cum_grad.mul(cum_grad).sum(2).sum(2).sqrt().sum(0) then it can work.