neural-compressor icon indicating copy to clipboard operation
neural-compressor copied to clipboard

how to get layer_mappings for distillation?

Open Michael-Fuu opened this issue 1 year ago • 1 comments

hi, I want to write scripts to print layer_mappings for distillation, my script like this: for name, module in model.named_modules(): print(name) while the results is far away from default layer_mapping. For example, when I use resnet50, the default result is [['resblock.1.feature.output', 'resblock.deepst.feature.output'], while my result is something like layer1.0.conv1. How to define the correct layer_mapping?

Michael-Fuu avatar Feb 01 '24 07:02 Michael-Fuu

Hi @Michael-Fuu , are you looking at this self distillation example? As you can see in the code below, this example does not follow the layer names (such as layer1.0.conv1 you mentioned) of original model (e.g. resnet50) for layer mapping, it creates layer names (such as resblock.1.feature.output) not related to the original model. image

XinyuYe-Intel avatar Feb 07 '24 02:02 XinyuYe-Intel