Tensorboard in RLLIB Algo Config without using Tune

How severe does this issue affect your experience of using Ray?

  • Low: It annoys or frustrates me for a moment.

I am trying to set the log directory for tensorboard during training. I found an example with Tune but I would like to know how to do it without it. I found an example on stackoverflow but it doesn’t seem to be working. Here is the code snippet and error I am getting

from ray.rllib.algorithms.ppo import PPOConfig
import os
from datetime import date

def custom_log_creator(custom_path, custom_str):

    timestr = date.today().strftime("%Y-%m-%d_%H-%M-%S")
    logdir_prefix = "{}_{}".format(custom_str, timestr)

    def logger_creator(config):

        if not os.path.exists(custom_path):
            os.makedirs(custom_path)
        logdir = tempfile.mkdtemp(prefix=logdir_prefix, dir=custom_path)
        return UnifiedLogger(config, logdir, loggers=None)

    return logger_creator

config = (  # 1. Configure the algorithm,
    PPOConfig()
    .environment("Taxi-v3")
    .rollouts(num_rollout_workers=2)
    .training(model={"fcnet_hiddens": [64, 64]}) # Model configuration: https://github.com/ray-project/ray/blob/master/rllib/models/catalog.py
    .evaluation(evaluation_num_workers=1)
    .logger_creator(custom_log_creator(os.path.expanduser("~/another_ray_results/subdir"), 'custom_dir'))
)

Error message obtained is

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[37], line 8
      1 config = (  # 1. Configure the algorithm,
      2     PPOConfig()
      3     .environment("Taxi-v3")
      4     .rollouts(num_rollout_workers=2)
      5 #     .framework("tf2")
      6     .training(model={"fcnet_hiddens": [64, 64]}) # Model configuration: https://github.com/ray-project/ray/blob/master/rllib/models/catalog.py
      7     .evaluation(evaluation_num_workers=1)
----> 8     .logger_creator(custom_log_creator(os.path.expanduser("~/another_ray_results/subdir"), 'custom_dir'))
      9 )
     10 #other config

TypeError: 'NoneType' object is not callable

Any help would be appreciated, thanks!