AttributeError: type object 'PPOConfig' has no attribute 'overrides'

Hi,

When copying from the example in Ray RLlib, I find code like this:
> config = (

    PPOConfig()
    # Also try common gym envs like: "CartPole-v1" or "Pendulum-v1".
    .environment(
        MultiAgentCustomRenderedEnv if args.multi_agent else CustomRenderedEnv,
        env_config={"corridor_length": 10, "max_steps": 100},
    )
    .framework(args.framework)
    # Use a vectorized env with 2 sub-envs.
    .rollouts(num_envs_per_worker=2, num_rollout_workers=1)
    .evaluation(
        # Evaluate once per training iteration.
        evaluation_interval=1,
        # Run evaluation on (at least) two episodes
        evaluation_duration=2,
        # ... using one evaluation worker (setting this to 0 will cause
        # evaluation to run on the local evaluation worker, blocking
        # training until evaluation is done).
        evaluation_num_workers=1,
        # Special evaluation config. Keys specified here will override
        # the same keys in the main config, but only for evaluation.
        evaluation_config=PPOConfig.overrides(
            # Render the env while evaluating.
            # Note that this will always only render the 1st RolloutWorker's
            # env and only the 1st sub-env in a vectorized env.
            render_env=True,
        ),
    )
)

However, it fails with:

AttributeError: type object ‘PPOConfig’ has no attribute ‘overrides’

Thanks!

Hi @Jorge_Costa_da_Silva ,

What you are looking at is this method.
The code you copied is likely taken from the RLlib repo with a more recent version than what you have installed.
Please install a newer version of RLlib and PPOConfig will have the overrides method.

Hi @arturn !

Thank you very much. In fact, I don’t have that version of the code. But I do have the last version of ray at this moment (2.2.0). What would your advice to upgrade rllib independently?

Thanks again,
Jorge

I don’t know when we introduced this. But you can always install nightlies :slight_smile:

Sure, it didn’t come to mind… Many thanks!