VainF / Torch-Pruning

[CVPR 2023] Towards Any Structural Pruning; LLMs / SAM / Diffusion / Transformers / YOLOv8 / CNNs
https://arxiv.org/abs/2301.12900
MIT License
2.59k stars 318 forks source link

How to reproduce the reported results of DepGraph on ImageNet? #275

Open dywu98 opened 10 months ago

dywu98 commented 10 months ago

Hi~ I want to reproduce the claimed ResNet-50 DepGraph 75.83 results on ImageNet.

However, I noticed that in the benchmark/readme.md, there is only an implementation of the Group-L1 by runing python -m torch.distributed.launch --nproc_per_node=4 --master_port 18119 --use_env main_imagenet.py --model resnet50 --epochs 90 --batch-size 64 --lr-step-size 30 --lr 0.01 --prune --method l1 --pretrained --output-dir run/imagenet/resnet50_sl --target-flops 2.00 --cache-dataset --print-freq 100 --workers 16 --data-path PATH_TO_IMAGENET --output-dir PATH_TO_OUTPUT_DIR # &> output.log.

So, I wonder is this above Group-L1(without sparse learning) script align with the claimed 75.83 result reported in the Paper?

If not, should I just run the benchmarks/scripts/prune/imagenet/resnet50_group_sl.sh to reproduce the reported result of DepGraph?

dywu98 commented 10 months ago

So far, following the provided code in benchmark/readme.md, I only get 75.32. I set the batchsize=128 and using 2 GPUs for training with lr=0.01 and method=l1. The rest of settings are exactly the same with yours.

I also tried to run the benchmarks/scripts/prune/imagenet/resnet50_group_sl.sh but I only get 73.77.

In order to reproduce your reported 75.83 results in the paper, could you please provide me some information about how to set all the settings correctly?