If I train the model using mixed precision Trainer(precision=16) and I want to evaluate the model using half precision (model.half()
), do I have to set to model back to model.float()
or just leave it in model.half()
after evaluation process?
def on_validation_epoch_start(self):
if self.precision == 16:
self.model.half()
def on_validation_epoch_end(self):
if self.precision == 16:
self.model.float()