(self, epoch, file_name)
Saving checkpoints

        :param epoch: current epoch number
        :param log: logging information of the epoch
        :param save_best: if True, rename the saved checkpoint to 'model_best.pth.tar'
Saving checkpoints
Saving checkpoints
def _save_checkpoint(self, epoch, file_name):
        """
        Saving checkpoints

        :param epoch: current epoch number
        :param log: logging information of the epoch
        :param save_best: if True, rename the saved checkpoint to 'model_best.pth.tar'
        """
        state_dict = self.model.module.state_dict() if self.config['distributed'] else self.model.state_dict()
        state = {
            'epoch': epoch,
            'global_step': self.global_step,
            'state_dict': state_dict,
            'optimizer': self.optimizer.state_dict(),
            'scheduler': self.scheduler.state_dict(),
            'config': self.config,
            'metrics': self.metrics
        }
        filename = os.path.join(self.checkpoint_dir, file_name)
        torch.save(state, filename)
def _save_checkpoint ( self , epoch , file_name ) : state_dict = self . model . module . state_dict ( ) if self . config [ 'distributed' ] else self . model . state_dict ( ) state = { 'epoch' : epoch , 'global_step' : self . global_step , 'state_dict' : state_dict , 'optimizer' : self . optimizer . state_dict ( ) , 'scheduler' : self . scheduler . state_dict ( ) , 'config' : self . config , 'metrics' : self . metrics } filename = os . path . join ( self . checkpoint_dir , file_name ) torch . save ( state , filename )