From b8a6408a11cdcfe304710d28cca6317dd091250b Mon Sep 17 00:00:00 2001 From: ananthsub Date: Sat, 3 Oct 2020 19:18:05 -0700 Subject: [PATCH] Update trainer.py (#3834) --- pytorch_lightning/trainer/trainer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytorch_lightning/trainer/trainer.py b/pytorch_lightning/trainer/trainer.py index 446591a436..32bcdcaf42 100644 --- a/pytorch_lightning/trainer/trainer.py +++ b/pytorch_lightning/trainer/trainer.py @@ -283,6 +283,9 @@ class Trainer( self.shown_warnings = set() # init callbacks + # Declare attributes to be set in callback_connector on_trainer_init + self.checkpoint_callback: Union[ModelCheckpoint, bool] = checkpoint_callback + self.early_stop_callback: Optional[Union[EarlyStopping, bool]] = early_stop_callback self.callback_connector.on_trainer_init( callbacks, early_stop_callback,