How to use pretrained=None? #450
Unanswered
Choi-YeonHyo
asked this question in
Q&A
Replies: 3 comments 2 replies
-
Did you manage to resolve your issue? I would also be interested to know :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
you can set the encoder_weights parameter to None. for freezing encoder, the following worked for me:
and then you have to make your optimizer filter for the parameters that have the
cheers |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks a lot.
And can I ask you one more question?
I want to train only U-Net (Not using other CNN encoder)
I tried to delete encoder part by encoder_name=None, but it didn’t worked.
Could you tell me how to use only U-Net which not using other encoder(ex, VGGNet, DenseNet, etc..)
I look forward to your reply.
Best regards.
Windows용 메일에서 발송된 메일입니다.
보낸 사람: Noushin Quazi
보낸 날짜: 2022년 2월 12일 토요일 오전 5:44
받는 사람: qubvel/segmentation_models.pytorch
참조: Choi-YeonHyo; Author
제목: Re: [qubvel/segmentation_models.pytorch] How to use pretrained=None?(Discussion #450)
you can set the encoder_weights parameter to None.
for freezing encoder, the following worked for me:
for param in model.encoder.parameters():
param.requires_grad = False
and then you have to make your optimizer filter for the parameters that have the requires_grad flag set to False like so:
optimizer = torch.optim.Adam(filter(lambda p: p.requires_grad, model.parameters()), lr = 0.001)
cheers
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to pretrained weight =None
but there are not available options.
and how to freeze encoder weight?
when i operate model.summary, there are only trainable parameters, not non-trainable parameter.
thanks.
Beta Was this translation helpful? Give feedback.
All reactions