(self, epoch, logs=None)
| 957 | self._current_epoch = epoch |
| 958 | |
| 959 | def on_epoch_end(self, epoch, logs=None): |
| 960 | self.epochs_since_last_save += 1 |
| 961 | # pylint: disable=protected-access |
| 962 | if self.save_freq == 'epoch': |
| 963 | if self.model._in_multi_worker_mode(): |
| 964 | # Exclude training state variables in user-requested checkpoint file. |
| 965 | with self._training_state.untrack_vars(): |
| 966 | self._save_model(epoch=epoch, logs=logs) |
| 967 | else: |
| 968 | self._save_model(epoch=epoch, logs=logs) |
| 969 | if self.model._in_multi_worker_mode(): |
| 970 | # For multi-worker training, back up the weights and current training |
| 971 | # state for possible future recovery. |
| 972 | # TODO(rchao): Call `back_up` at finer period such as N steps. |
| 973 | self._training_state.back_up(epoch) |
| 974 | |
| 975 | def _save_model(self, epoch, logs): |
| 976 | """Saves the model. |
nothing calls this directly
no test coverage detected