Add checkpoint saving on graceful shutdown (ctr+c) (#3067)

This commit is contained in:
Kaushal Bhogale 2020-08-20 15:43:34 +05:30 committed by GitHub
parent f43028f3ae
commit 7933a1121c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1132,6 +1132,10 @@ class TrainerTrainLoopMixin(ABC):
self._teardown_already_run = True
# Save latest checkpoint
log.info('Saving latest checkpoint..')
self.check_checkpoint_callback(should_check_val=False)
# Train end events
with self.profiler.profile('on_train_end'):
# callbacks