dongkwonjin / RVLD

Official code for "Recursive Video Lane Detection", ICCV 2023
Apache License 2.0
77 stars 9 forks source link

关于`classifier.eval()`的疑问 #10

Closed 578223592 closed 11 months ago

578223592 commented 1 year ago

感谢您优秀的工作。 在代码中我看到self.model.classifier.eval(),请问处于什么考量不训练classifier呢?

    def finetune_model(self):
        val1 = True
        val2 = False

        for param in self.model.regressor.parameters():
            param.requires_grad = val1  #
        for param in self.model.offset_regression.parameters():
            param.requires_grad = val1
        for param in self.model.deform_conv2d.parameters():
            param.requires_grad = val1
        for param in self.model.classifier.parameters():
            param.requires_grad = val2
        if val1 == False:
            self.model.regressor.eval() 
            self.model.offset_regression.eval()
            self.model.deform_conv2d.eval()
        if val2 == False:
            self.model.classifier.eval()
dongkwonjin commented 11 months ago

We set to stabilize the training. It is also possible to train the classifier without "eval" mode.

Thank you for your attention. We are sorry for the late reply.