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