(epoch)
| 74 | |
| 75 | |
| 76 | def checkpoint(epoch): |
| 77 | model_out_path = "model_epoch_{}.pth".format(epoch) |
| 78 | torch.save(model, model_out_path) |
| 79 | print("Checkpoint saved to {}".format(model_out_path)) |
| 80 | |
| 81 | for epoch in range(1, opt.nEpochs + 1): |
| 82 | train(epoch) |