KaiyangZhou / pytorch-center-loss

Pytorch implementation of Center Loss
MIT License
970 stars 219 forks source link

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

Open mohamedr002 opened 3 years ago

toannguyen1904 commented 2 years ago

can you give us an example?

cotyyang commented 1 year ago

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)

mohamedr002 commented 1 year ago

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,

fafafafafafafa commented 1 year ago

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