def restore(self):
    self.trainer.writer.write('Restoring checkpoint')
    best_path = os.path.join(self.ckpt_foldername, (self.ckpt_prefix + 'best.ckpt'))
    if os.path.exists(best_path):
        ckpt = self._torch_load(best_path)
        self.trainer.model.load_state_dict(ckpt['model'])
        self.trainer.optimizer.load_state_dict(ckpt['optimizer'])
def restore(self):
    self.trainer.writer.write('Restoring checkpoint')
    best_path = os.path.join(self.ckpt_foldername, (self.ckpt_prefix + 'best.ckpt'))
    if os.path.exists(best_path):
        ckpt = self._torch_load(best_path)
        self.trainer.model.load_state_dict(ckpt['model'])
        self.trainer.optimizer.load_state_dict(ckpt['optimizer'])