Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't find the “frozen_parameters” parameter in the relevant source code #83

Closed
wwwbq opened this issue May 13, 2022 · 2 comments
Closed

Comments

@wwwbq
Copy link

wwwbq commented May 13, 2022

I found that the “frozen_parameters” parameter is used in many detection models, but I have not found where this parameter is used in the relevant source code. Which part of the source code should I see?

@BIGWangYuDong
Copy link
Collaborator

BIGWangYuDong commented May 13, 2022

The code is as follow

if frozen_parameters is not None:
print_log(f'Frozen parameters: {frozen_parameters}', logger)
for name, param in model.named_parameters():
for frozen_prefix in frozen_parameters:
if frozen_prefix in name:
param.requires_grad = False
if param.requires_grad:
print_log(f'Training parameters: {name}', logger)
return model

@wwwbq
Copy link
Author

wwwbq commented May 13, 2022

The code is as follow

if frozen_parameters is not None:
print_log(f'Frozen parameters: {frozen_parameters}', logger)
for name, param in model.named_parameters():
for frozen_prefix in frozen_parameters:
if frozen_prefix in name:
param.requires_grad = False
if param.requires_grad:
print_log(f'Training parameters: {name}', logger)
return model

Thanks for your help !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants