1,“Did you add the whole params ( include model.parameters(), and loss.parameters() )to the  optimizer in the first way ?”      yes
"trainable = [{‘params’: loss.parameters(), ‘lr’: args.lr},
{‘params’: model.parameters(), ‘lr’: args.lr}] "

微信图片_20190319144521.png537×696 22.8 KB

2, i use the resnet and arcface for face recognition ,other than the original resnet code: i delete last FC layer from resnet.py , but put it in my arcface.py (which is my loss function) , and my training code as below:
raw_output = self.model(img)   # i delete last FC layer from resnet50
raw_output = self.loss(raw_output, id)  # the last FC layer is here.
loss = criterion(raw_output,id.long())
my optimization code:
"trainable = [{‘params’: loss.parameters(), ‘lr’: args.lr},
{‘params’: model.parameters(), ‘lr’: args.lr}] "