How to use the parl.utils.logger.get_dir function in parl

To help you get started, we’ve selected a few parl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PaddlePaddle / PARL / parl / utils / tensorboard.py View on Github external
def call(*args, **kwargs):
        global _writer
        if _writer is None:
            logdir = logger.get_dir()
            if logdir is None:
                logdir = logger.auto_set_dir(action='d')
                logger.warning(
                    "[tensorboard] logdir is None, will save tensorboard files to {}"
                    .format(logdir))
            _writer = SummaryWriter(logdir=logger.get_dir())
        func = getattr(_writer, func_name)
        func(*args, **kwargs)
        _writer.flush()
github kosoraYintai / PARL-Sample / dqn_dnn / TrainMaze.py View on Github external
def restore(agent):
    learnDir = os.path.join(logger.get_dir(),'learn_01')
    predictDir = os.path.join(logger.get_dir(),'predict_01')   
    logger.info('restore model from {}'.format(learnDir))
    agent.load_params(learnDir,predictDir)
github PaddlePaddle / PARL / parl / utils / tensorboard.py View on Github external
def call(*args, **kwargs):
        global _writer
        if _writer is None:
            logdir = logger.get_dir()
            if logdir is None:
                logdir = logger.auto_set_dir(action='d')
                logger.warning(
                    "[tensorboard] logdir is None, will save tensorboard files to {}"
                    .format(logdir))
            _writer = SummaryWriter(logdir=logger.get_dir())
        func = getattr(_writer, func_name)
        func(*args, **kwargs)
        _writer.flush()
github kosoraYintai / PARL-Sample / flappy_bird / Train_Bird_PriorityRPM.py View on Github external
def restore(agent):
    learnDir = os.path.join(logger.get_dir(),'learn')
    predictDir = os.path.join(logger.get_dir(),'predict')   
    print('restore model from {}'.format(learnDir))
    agent.load_params(learnDir,predictDir)
github kosoraYintai / PARL-Sample / flappy_bird / Train_Test_Working_Flow.py View on Github external
def save(agent):
    learnDir = os.path.join(logger.get_dir(),'learn')
    predictDir = os.path.join(logger.get_dir(),'predict')
    agent.save_params(learnDir,predictDir)
github kosoraYintai / PARL-Sample / flappy_bird / Train_Bird_PriorityRPM.py View on Github external
def save(agent):
    learnDir = os.path.join(logger.get_dir(),'learn')
    predictDir = os.path.join(logger.get_dir(),'predict')
    agent.save_params(learnDir,predictDir)
github kosoraYintai / PARL-Sample / dqn_dnn / TrainMaze.py View on Github external
def save(agent):
    learnDir = os.path.join(logger.get_dir(),'learn_01')
    predictDir = os.path.join(logger.get_dir(),'predict_01')
    agent.save_params(learnDir,predictDir)