I want to know how to set arguments of optimizer() when loading a pretrained net with its gradient fix to a new net.  My understanding that I should assign only the remaining other subset of a new_net to optimizer first argument.  Assume that the pretrained net is a subset of a new net.
Here is a example;
class PretrainedNet:
…
class NewNet
…
pretrained_net = PretrainedNet
new_net = NewNet
set grad of pretrained_net fix
for param in pretrined_net.parameters()
param.requires_grad = False
#Copy pretrained_net state_dict to a new_net state_dict with others remaining same in new_net state_dict.
pretrained_dict = pretrained_net.state_dict()
new_dict= new_net.state.dict()
new_dict.update(pretrained_dict)
new_net.load_state_dict(new_dict, strict=True)
Assume that I know the remaining other subset of the new_net includes;
a = pytorch.nn.aaa()
b = pytorc.nn.bbb()
c = pytorch.nn.(ccc()
When I tried to set up optimizer
optimizer = Adam([a.parameters(), b.parameters(), c.parameters()])
I got TypeError: optimizer can only optimize Variables, but one of the params is Module.parameters.
What is the right coding for optimizer? Thank you for any help in advance.