[Fix] Add MAE LayerDecayOptimizerConstructor (#1539)

This commit is contained in:
FangjianLin 2022-05-01 12:42:49 +08:00 committed by GitHub
parent f33b7cafc8
commit 40ae7edd49

View File

@ -143,7 +143,8 @@ class LearningRateDecayOptimizerConstructor(DefaultOptimizerConstructor):
layer_id = get_layer_id_for_convnext(
name, self.paramwise_cfg.get('num_layers'))
logger.info(f'set param {name} as id {layer_id}')
elif 'BEiT' in module.backbone.__class__.__name__:
elif 'BEiT' in module.backbone.__class__.__name__ or \
'MAE' in module.backbone.__class__.__name__:
layer_id = get_layer_id_for_vit(name, num_layers)
logger.info(f'set param {name} as id {layer_id}')
else: