Add stop_training=False flag to callbacks (#6365)

* New flag 'stop_training' in util.callbacks.Callbacks class to prematurely stop training from callback handler

* Removed most of the new  checks, leaving only the one after calling 'on_train_batch_end'

* Cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
MatthiasandGlenn Jocher authored and GitHub committed 2022-01-22 16:37:21 -10:00
1 parent c43439aa31
commit 8efe97719c
2 files changed
+3

No files matched your search

+1
View File
@@ -35,6 +35,7 @@ class Callbacks:
'on_params_update': [],
'teardown': [],
}
self.stop_training = False # set True to interrupt training
def register_action(self, hook, name='', callback=None):
"""