- super(ModelCheckpoint, self).__init__()
- self.monitor = monitor
- self.verbose = verbose
- self.filepath = filepath
- self.save_best_only = save_best_only
- self.save_weights_only = save_weights_only
- self.save_freq = save_freq
- self.epochs_since_last_save = 0
- self._samples_seen_since_last_saving = 0
-
- # Deprecated field `load_weights_on_restart` is for loading the checkpoint
- # file from `filepath` at the start of `model.fit()`
- # TODO(rchao): Remove the arg during next breaking release.
- if 'load_weights_on_restart' in kwargs:
- self.load_weights_on_restart = kwargs['load_weights_on_restart']
- logging.warning('`load_weights_on_restart` argument is deprecated. '
- 'Please use `model.load_weights()` for loading weights '
- 'before the start of `model.fit()`.')
- else:
- self.load_weights_on_restart = False
-