In the training loop, we should catch KeyboardInterrupt exceptions and enter a graceful termination (ie. run on_training_end, print profiler report, etc).
Sometimes I'll train a model and just let it run until something interesting happens or my loss has converged. Exiting via "Ctrl + C" can be easier than waiting for "EarlyStopping" to trigger in some cases. However, I may still want certain things to occur (eg. printing out the profiler summary) after stopping training.
Salesforce's AWD-LSTM has an example of this feature implemented here.
Figure out what actions we want to run after a KeyboardInterrupt. Then adjust the training loop to catch this exception and ensure the aforementioned actions still run afterwards.
awesome, let's do it
@jeremyjordan can we get it into this release? :)
when鈥檚 the release? planning to get to it this weekend
feb 21
sure, shouldn't be a problem then :)
Hey guys, I am currently training a model on Sagemaker and have added a notebook shutdown code within the on_training_end method. There were times where I had to manually cancel my model training because something was wrong. However, If I do that, the notebook shuts down. Is there any way to make this feature optional? I don't want my notebook shutting down after a keyboard interrupt, only after successful training completion.
@lezwon Hmm yeah, that's not ideal. Do you mind creating a new issue (you can reference this one) with the problem and I can draft up a PR to address it?
Most helpful comment
@lezwon Hmm yeah, that's not ideal. Do you mind creating a new issue (you can reference this one) with the problem and I can draft up a PR to address it?