pytorch-center-loss icon indicating copy to clipboard operation
pytorch-center-loss copied to clipboard

remember to include The center loss parameters in the optimizer, othewise it will not work

Open mohamedr002 opened this issue 3 years ago • 4 comments

mohamedr002 avatar Oct 17 '21 11:10 mohamedr002

can you give us an example?

toannguyen1904 avatar Aug 11 '22 04:08 toannguyen1904

can you give us an example?

maybe he mean is this. in main.py 80 line optimizer_centloss = torch.optim.SGD(criterion_cent.parameters(), lr=args.lr_cent)

cotyyang avatar Dec 20 '22 09:12 cotyyang

can you give us an example?

maybe he mean is this. in main.py 80 line optimizer_centloss = torch.optim.SGD(criterion_cent.parameters(), lr=args.lr_cent)

Yes, exactly, this is what I meant, the center loss parameters are trainable parameters and should be updated during training, by excluding these parameter from the optimizer, it will not change,

mohamedr002 avatar Dec 20 '22 09:12 mohamedr002

why i put optimizer_centloss into optimizer, raise ValueError("optimizer got an empty parameter list"? anyone can help me?

fafafafafafafa avatar Feb 06 '23 14:02 fafafafafafafa