def load_saved_status(self):
    'Load checkpoint from disk'
    if os.path.exists(self.last_model_path):
        print_rank('Resuming from checkpoint model {}'.format(self.last_model_path))
        self.worker_trainer.load(self.last_model_path, update_lr_scheduler=True, update_ss_scheduler=True)
        if (self.server_trainer is not None):
            self.server_trainer.model = self.worker_trainer.model
    if os.path.exists(self.log_path):
        with open(self.log_path, 'r') as logfp:
            elems = json.load(logfp)
            self.cur_iter_no = elems.get('i', 0)
            self.metrics['best_val_loss'] = elems.get('best_val_loss', float('inf'))
            self.metrics['best_val_acc'] = elems.get('best_val_acc', 0)
            self.metrics['best_test_loss'] = elems.get('best_test_loss', float('inf'))
            self.metrics['best_test_acc'] = elems.get('best_test_acc', 0)
            self.lr_weight = elems.get('weight', 1.0)
            self.no_label_updates = elems.get('num_label_updates', 0)
            print_rank(f'Resuming from status_log: cur_iter: {self.cur_iter_no}')
Load checkpoint from disk
def load_saved_status(self):
    
    if os.path.exists(self.last_model_path):
        print_rank('Resuming from checkpoint model {}'.format(self.last_model_path))
        self.worker_trainer.load(self.last_model_path, update_lr_scheduler=True, update_ss_scheduler=True)
        if (self.server_trainer is not None):
            self.server_trainer.model = self.worker_trainer.model
    if os.path.exists(self.log_path):
        with open(self.log_path, 'r') as logfp:
            elems = json.load(logfp)
            self.cur_iter_no = elems.get('i', 0)
            self.metrics['best_val_loss'] = elems.get('best_val_loss', float('inf'))
            self.metrics['best_val_acc'] = elems.get('best_val_acc', 0)
            self.metrics['best_test_loss'] = elems.get('best_test_loss', float('inf'))
            self.metrics['best_test_acc'] = elems.get('best_test_acc', 0)
            self.lr_weight = elems.get('weight', 1.0)
            self.no_label_updates = elems.get('num_label_updates', 0)
            print_rank(f'Resuming from status_log: cur_iter: {self.cur_iter_no}')