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


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

    # Also try common gym envs like: "CartPole-v1" or "Pendulum-v1".
        MultiAgentCustomRenderedEnv if args.multi_agent else CustomRenderedEnv,
        env_config={"corridor_length": 10, "max_steps": 100},
    # Use a vectorized env with 2 sub-envs.
    .rollouts(num_envs_per_worker=2, num_rollout_workers=1)
        # Evaluate once per training iteration.
        # Run evaluation on (at least) two episodes
        # ... using one evaluation worker (setting this to 0 will cause
        # evaluation to run on the local evaluation worker, blocking
        # training until evaluation is done).
        # Special evaluation config. Keys specified here will override
        # the same keys in the main config, but only for evaluation.
            # 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.

However, it fails with:

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


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,

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!