zyxxmu / White-Box

Pytorch implementation of our paper accepted by IEEE TNNLS, 2022 — Carrying out CNN Channel Pruning in a White Box
17 stars 2 forks source link

VGG.sh #2

Open HXuan-Wang opened 1 year ago

HXuan-Wang commented 1 year ago

Hi zyxxmu First of all, thanks for sharing the code of such an amazing work. However, I tried seveal times by following the gudiances of /scripts/vgg.sh on CIFAR10 to reprodcue the results of them but failed. My results of vgg can only get 10% accuracy both on pytorch 1.8.2. So do you know what is the problem of it? Could you provide all the parameters required for the experiment? I would be very grateful if you could reply to me. Kind Regards

HXuan-Wang commented 1 year ago

The experiment setting as follow: 1661572147619

zyxxmu commented 1 year ago

Seems to be strange here. Can you share your training logs?

HXuan-Wang commented 1 year ago

The performance of VGG_class is 100%. However, the performance of the pruned VGG model is only 10%. 1661695154545 1661695297998

zyxxmu commented 1 year ago

From the log, I think some layers may be completely pruned, you can print the layerwise configuration to figure out this and try a smaller sparse_lambda.

qy513449931 commented 7 months ago

Hi zyxxmu First of all, thanks for sharing the code of such an amazing work. However, I tried seveal times by following the gudiances of /scripts/vgg.sh on CIFAR10 to reprodcue the results of them but failed. My results of vgg can only get 10% accuracy both on pytorch 1.8.2. So do you know what is the problem of it? I would be very grateful if you could reply to me. The performance of VGG_class is 100%. However, the performance of the pruned VGG model is only 10%.

qy513449931 commented 7 months ago

this is pruned VGG model 11/21 01:03:50 PM | VGG( (features): Sequential( (0): Conv2d(3, 33, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (1): BatchNorm2d(33, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (2): ReLU(inplace=True) (3): Conv2d(33, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (4): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (5): ReLU(inplace=True) (6): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (7): Conv2d(32, 89, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (8): BatchNorm2d(89, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (9): ReLU(inplace=True) (10): Conv2d(89, 95, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (11): BatchNorm2d(95, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (12): ReLU(inplace=True) (13): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (14): Conv2d(95, 152, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (15): BatchNorm2d(152, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (16): ReLU(inplace=True) (17): Conv2d(152, 89, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (18): BatchNorm2d(89, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (19): ReLU(inplace=True) (20): Conv2d(89, 113, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (21): BatchNorm2d(113, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (22): ReLU(inplace=True) (23): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (24): Conv2d(113, 177, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (25): BatchNorm2d(177, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (26): ReLU(inplace=True) (27): Conv2d(177, 229, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (28): BatchNorm2d(229, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (29): ReLU(inplace=True) (30): Conv2d(229, 153, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (31): BatchNorm2d(153, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (32): ReLU(inplace=True) (33): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (34): Conv2d(153, 153, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (35): BatchNorm2d(153, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (36): ReLU(inplace=True) (37): Conv2d(153, 153, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (38): BatchNorm2d(153, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (39): ReLU(inplace=True) (40): Conv2d(153, 129, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (41): BatchNorm2d(129, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (42): ReLU(inplace=True) (43): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (44): AvgPool2d(kernel_size=1, stride=1, padding=0) ) (classifier): Linear(in_features=129, out_features=10, bias=True) )