You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to stop the training in the model when some criteria are satisfied. Something along the lines:
class myCallback(Callback):
def __init__(self):
...
def on_epoch_end(self, trainer, pl_module):
if criteria:
model.stop_training = True # stops the training; need help here
Note that I also want to have the early stopping feature where the 'val_loss' is monitored but want to stop running the code if some other criteria is satisfied. Also, is my method of having this feature in the callback module correct or should I inherit the early stopping criteria?
The text was updated successfully, but these errors were encountered:
You could raise KeyboardInterrupt, this will lead to a graceful shutdown. There is some work in progress in this PR: #1631
But it should already work if you raise it from within your code
Is there a way to stop the training in the model when some criteria are satisfied. Something along the lines:
Note that I also want to have the early stopping feature where the 'val_loss' is monitored but want to stop running the code if some other criteria is satisfied. Also, is my method of having this feature in the callback module correct or should I inherit the early stopping criteria?
The text was updated successfully, but these errors were encountered: