(model,filename,optimizer,lr)
| 55 | torch.save(obj=checkpoint,f=filename) |
| 56 | |
| 57 | def load_checkPoint(model,filename,optimizer,lr): |
| 58 | print("=========>") |
| 59 | checkpoint = torch.load(f=filename,map_location=config.BEATAS) |
| 60 | model.load_state_dict(checkpoint["state_dict"]) |
| 61 | optimizer.load_state_dict(checkpoint["optimizer"]) |
| 62 | |
| 63 | for param_group in optimizer.param_groups: |
| 64 | param_group["lr"] = lr |
nothing calls this directly
no outgoing calls
no test coverage detected