How to stop rollout worker notifications/warnings?

Hi there!

I’m currently working on a control theory problem which depends on a series of equation parameters. Essentially, it is about how RL can yield better results than more traditional control theory approaches for the type of system.

I’m using RLlib, in particular a PPO agent defined through PPOConfig() using the following function:

def create_agent(env_class, parameters_obj, *, datacode = "DEFAULT", env_name="testEnvName", fluctuating=True, training=True):
  config = ppo.PPOConfig() = 50.0)
  config = config.resources(num_gpus=torch.cuda.device_count())
  config.create_env_on_local_worker = True
  config.env_config["parameters"] = parameters_obj.parameters()
  config.env_config["growth_fn"] = _datacode_to_growth_fn[datacode]
  config.env_config["fluctuating"] = fluctuating
  config.env_config["training"] = training
  config.env_config["initial_pop"] = parameters_obj.init_state()
  agent = PPOTrainer(config=config)
  return agent

Now, here’s my (I guess very basic) problem:

I’m training agents individually for a series of problem parameter values (essentially, I sample the physical parameters from a distribution, and for each sample, I train an agent for that particular control problem).

I’d like to keep ray as ‘quiet’ as possible on my terminal, so that the relevant information I print on the progress of the experiment isn’t lost in a maze of rollout worker messages. I’d like to make ray ‘non-verbose’ in that sense - I would like to not have messages such as the following in my terminal each time I build a PPO agent:

(RolloutWorker pid=228456) 2023-05-16 02:17:28,584  WARNING -- Your env doesn't have a .spec.max_episode_steps attribute. Your horizon will default to infinity, and your environment will not be reset.
(RolloutWorker pid=228456) 2023-05-16 02:17:28,584      WARNING -- Your env reset() method appears to take 'seed' or 'return_info' arguments. Note that these are not yet supported in RLlib. Seeding will take place using 'env.seed()' and the info dict will not be returned from reset.

Is there a way of ‘turning off’ these types of messages on ray?


Try using ray.init(logging_level="info", log_to_driver=True); reference: [Core] Logging INFO Messages are not showing · Issue #17374 · ray-project/ray · GitHub