# Example code failed---multi\_agent\_two\_trainers.py

**URL:** <https://discuss.ray.io/t/example-code-failed-multi-agent-two-trainers-py/14086>\
**Category:** RLlib\
**Created:** [March 20, 2024, 3:40pm UTC](https://discuss.ray.io/t/example-code-failed-multi-agent-two-trainers-py/14086 "2024-03-20T15:40:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SS\_D](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ss_d/32/4463_2.png) [@SS\_D](https://discuss.ray.io/u/SS_D)\
**Post date:** [March 20, 2024, 3:40pm UTC](https://discuss.ray.io/t/example-code-failed-multi-agent-two-trainers-py/14086/1 "2024-03-20T15:40:37Z")

</div>

- High: It blocks me to complete my task.

1. When attempting to run the example script multi\_agent\_two\_trainers.py from ray/rllib/examples, I encountered a TypeError indicating an unexpected keyword argument \_enable\_new\_api\_stack in the AlgorithmConfig.experimental() method.

2. After commenting out the line involving \_enable\_new\_api\_stack=False, I encountered another error during the execution, related to a mismatch in the state dictionary keys when trying to load weights for the FullyConnectedNetwork\_as\_DQNTorchModel, suggesting missing keys and unexpected keys in the state dict.

### part modified in original file

```
ppo_config = (
    PPOConfig()
    # .experimental(_enable_new_api_stack=False) ### First try without change
    # .experimental( ) ### Second try without param setting inside

```

#### source code

[https://github.com/ray-project/ray/blob/master/rllib/examples/multi\_agent\_two\_trainers.py](https://github.com/ray-project/ray/blob/master/rllib/examples/multi_agent_two_trainers.py)

### Versions / Dependencies

Name: torch  
Version: 2.1.0

Name: ray  
Version: 2.7.1

Python 3.11.4
