SegmentationBLWX / sssegmentation

SSSegmentation: An Open Source Supervised Semantic Segmentation Toolbox Based on PyTorch.
https://sssegmentation.readthedocs.io/en/latest/
Apache License 2.0
775 stars 107 forks source link

[Question] Why passing the frozen parameters which require_grad = False to optimizers ? #54

Closed STHxiao closed 1 month ago

STHxiao commented 2 months ago

In method 'groupparams' which located in class 'DefaultParamsConstructor', I See the code shown below. The parameters which require_grad = False will pass to optimizers when filter_params = False. I don't understand why this needs to be done. Can't the optimizer only accept parameters that require gradients? Thank you very much.

STHxiao commented 2 months ago

image

CharlesPikachu commented 1 month ago

plz refer to pytorch official document (optimizer section)