()
| 181 | |
| 182 | # hacky way to avoid define this in the traininer module |
| 183 | def stop_training_method(): |
| 184 | module.stop_training = False |
| 185 | print("-" * 40) |
| 186 | print("Try to save checkpoint to {}".format(ckpt_dir)) |
| 187 | module.trainer.save_checkpoint(os.path.join(ckpt_dir, "interrupted.ckpt")) |
| 188 | module.trainer.should_stop = True |
| 189 | module.trainer.limit_val_batches = 0 |
| 190 | print("Saved checkpoint.") |
| 191 | print("-" * 40) |
| 192 | |
| 193 | module.stop_training_method = stop_training_method |
| 194 |
nothing calls this directly
no outgoing calls
no test coverage detected