(self, load_path)
| 245 | self.print_fn(f"model saved: {save_filename}") |
| 246 | |
| 247 | def load_model(self, load_path): |
| 248 | checkpoint = torch.load(load_path) |
| 249 | |
| 250 | self.model.load_state_dict(checkpoint['model']) |
| 251 | self.optimizer.load_state_dict(checkpoint['optimizer']) |
| 252 | self.scheduler.load_state_dict(checkpoint['scheduler']) |
| 253 | self.it = checkpoint['it'] |
| 254 | self.ema_model.load_state_dict(checkpoint['ema_model']) |
| 255 | self.print_fn('model loaded') |
| 256 | |
| 257 | # Abandoned in PiModel |
| 258 | def interleave_offsets(self, batch, nu): |