(ckpt_path, model, logger)
| 39 | return max_accuracy |
| 40 | |
| 41 | def load_pretrained(ckpt_path, model, logger): |
| 42 | logger.info(f"==============> Loading pretrained form {ckpt_path}....................") |
| 43 | checkpoint = torch.load(ckpt_path, map_location='cpu') |
| 44 | msg = model.load_pretrained(checkpoint['model']) |
| 45 | logger.info(msg) |
| 46 | logger.info(f"=> Loaded successfully {ckpt_path} ") |
| 47 | del checkpoint |
| 48 | torch.cuda.empty_cache() |
| 49 | |
| 50 | |
| 51 | def save_checkpoint(config, epoch, model, max_accuracy, optimizer, lr_scheduler, logger): |
no test coverage detected