转载链接:https://github.com/facebookresearch/Detectron/issues/586
lsrock1提到了,在resnet.py中使用了stopgradient 来进行对于该层开始之前的层进行freeze,但是不能freeze某一个特定的层
zeenolife 回答:
There is a method TrainableParams()
in DetectionModelHelper
class in detectron/modeling/detector.py
which returns all trainable params. It depends on self.do_not_update_params
list, so you can actually somehow append your param names to it manually and that would effectively freeze the weight. That might help.