spmallick / learnopencv

Learn OpenCV : C++ and Python Examples
https://www.learnopencv.com/
21.35k stars 11.62k forks source link

how to adjust the learning rate parameter of PyTorch-Multi-Label-Image-Classification code #927

Open liulan93 opened 5 months ago

liulan93 commented 5 months ago

As the code of train.py doesn't have learning rate parameter, how should I adjust this parameter? https://github.com/spmallick/learnopencv/blob/master/PyTorch-Multi-Label-Image-Classification/train.py

brmarkus commented 5 months ago

Have a look under e.g. "https://pytorch.org/docs/stable/optim.html#constructing-it" about constructing an Optimizer,

Then you could just add the lr argument to e.g. "https://github.com/spmallick/learnopencv/blob/master/PyTorch-Multi-Label-Image-Classification/train.py#L67", isn't it?