raoyongming / DenseCLIP

[CVPR 2022] DenseCLIP: Language-Guided Dense Prediction with Context-Aware Prompting
505 stars 38 forks source link

What does "We fix the text encoder during training" mean? Does it mean that the parameters are not updated during training? #33

Closed sunwhw closed 1 year ago

sunwhw commented 1 year ago

Thanks for your great work! Does "We fix the text encoder during training" mean that the parameters of text encoder are not updated during training? If so, I can't find any "requires_grad=False" settings in the source code.

sunwhw commented 1 year ago

ok fine! I think I find the answer. Is this part? " optimizer = dict(type='AdamW', lr=0.0001, weight_decay=0.0001, paramwise_cfg=dict(custom_keys={'backbone': dict(lr_mult=0.1), 'text_encoder': dict(lr_mult=0.0), 'norm': dict(decay_mult=0.)})) " and Does "text_encoder': dict(lr_mult=0.0)" finish the work?

raoyongming commented 1 year ago

ok fine! I think I find the answer. Is this part? " optimizer = dict(type='AdamW', lr=0.0001, weight_decay=0.0001, paramwise_cfg=dict(custom_keys={'backbone': dict(lr_mult=0.1), 'text_encoder': dict(lr_mult=0.0), 'norm': dict(decay_mult=0.)})) " and Does "text_encoder': dict(lr_mult=0.0)" finish the work?

Yes. We fix the text encoder by setting its learning rate to 0 which can be simply implemented with a single line of code as you mentioned.

sunwhw commented 1 year ago

Appreciate it.