youzhonghui / gate-decorator-pruning

Code for the NuerIPS'19 paper "Gate Decorator: Global Filter Pruning Method for Accelerating Deep Convolutional Neural Networks"
Apache License 2.0
196 stars 29 forks source link

怎么正确加载剪枝完的pth模型呢 #25

Open XinyingZheng opened 2 years ago

XinyingZheng commented 2 years ago

剪枝完保存的pth文件加载时权重名都变了,还有对应的通道数,这个咋看,怎么正确加载剪枝完的pth模型呢

Unexpected key(s) in state_dict: "bn1.g", "bn1.area", "bn1.score", "bn1.bn_mask", "bn1.bn.weight", "bn1.bn.bias", "bn1.bn.running_mean", "bn1.bn.running_var", "bn1.bn.num_batches_tracked", "layer1.0.bn1.g", "layer1.0.bn1.area", "layer1.0.bn1.score", "layer1.0.bn1.bn_mask", "layer1.0.bn1.bn.weight", "layer1.0.bn1.bn.bias", "layer1.0.bn1.bn.running_mean", "layer1.0.bn1.bn.running_var", "layer1.0.bn1.bn.num_batches_tracked", "layer1.0.bn2.g", "layer1.0.bn2.area", "layer1.0.bn2.score", "layer1.0.bn2.bn_mask", "layer1.0.bn2.bn.weight", "layer1.0.bn2.bn.bias", "layer1.0.bn2.bn.running_mean", "layer1.0.bn2.bn.running_var", "layer1.0.bn2.bn.num_batches_tracked", "layer1.0.shortcut.1.g", "layer1.0.shortcut.1.area", "layer1.0.shortcut.1.score", "layer1.0.shortcut.1.bn_mask", "layer1.0.shortcut.1.bn.weight", "layer1.0.shortcut.1.bn.bias", "layer1.0.shortcut.1.bn.running_mean", "layer1.0.shortcut.1.bn.running_var", "layer1.0.shortcut.1.bn.num_batches_tracked", "layer1.1.bn1.g", "layer1.1.bn1.area", "layer1.1.bn1.score", "layer1.1.bn1.bn_mask", "layer1.1.bn1.bn.weight",