huawei-noah / vega

AutoML tools chain
http://www.noahlab.com.hk/opensource/vega/
Other
842 stars 175 forks source link

error in pruneEA #117

Open aswanthkrishna opened 3 years ago

aswanthkrishna commented 3 years ago

getting a shape mismatch error in fully train step of prune_ea algorithm. how can i solve this issue?


        Missing key(s) in state_dict: "backbone.layers.PruneBasicBlock0.block.1.conv1.weight", "backbone.layers.PruneBasicBlock0.block.1.batch.weight", "backbone.layers.PruneBasicBlock0.block.1.batch.bias", "backbone.layers.PruneBasicBlock0.block.1.batch.running_mean", "backbone.layers.PruneBasicBlock0.block.1.batch.running_var". 
        size mismatch for backbone.layers.PruneBasicBlock0.block.0.conv1.weight: copying a param with shape torch.Size([16, 16, 3, 3]) from checkpoint, the shape in current model is torch.Size([1, 16, 3, 3]).
        size mismatch for backbone.layers.PruneBasicBlock0.block.0.bn1.weight: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([1]).```
zhangjiajin commented 3 years ago

@aswanthkrishna

This is a known bug because the wrong model was loaded. We will update the version in the next week to fix this bug.

aswanthkrishna commented 3 years ago

thanks for the clarification. Is it possible to prune custom models with pruneEA algorithm?

zhangjiajin commented 3 years ago

Vega supports user custome model pruning for ResNet TensorFlow and MindSpore platform models, but does not support user custom PyTorch model pruning. The pytorch model pruning supported by Vega is a modified ResNet. You can refer to Prune-EA's code and try to adapt your own model.

code