# Algo.train() calls env.step() with empty action object

**URL:** <https://discuss.ray.io/t/algo-train-calls-env-step-with-empty-action-object/11472>\
**Category:** RLlib\
**Created:** [July 19, 2023, 6:31am UTC](https://discuss.ray.io/t/algo-train-calls-env-step-with-empty-action-object/11472 "2023-07-19T06:31:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuni](https://avatars.discourse-cdn.com/v4/letter/y/ee59a6/32.png) [@yuni](https://discuss.ray.io/u/yuni)\
**Post date:** [July 19, 2023, 6:31am UTC](https://discuss.ray.io/t/algo-train-calls-env-step-with-empty-action-object/11472/1 "2023-07-19T06:31:48Z")

</div>

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

- High: It blocks me to complete my task.

I made a custom MultiAgentEnv class, and when I print `action_dict` at the beginning of my `step(self, action_dict)` method, it’s just an empty object (`{}`). Shouldn’t `algo.train()` sample actions from `self.action_space` and use that as the argument?

I ran `GuessTheNumberGame` from [rllib examples](https://github.com/ray-project/ray/blob/master/rllib/examples/env/multi_agent.py) and it’s giving me the same error. I’m very new to Ray/RLlib and not sure what I’m missing.

I have ray 2.5.1, and below is my `algo`:

```auto
algo = (
    PPOConfig()
    .environment(GuessTheNumberGame)
    .build()
)
result = algo.train()

```

Sorry if this is a silly misunderstanding, and thanks for the help!

---

<div class="post-metadata">

**Author:** ![hridayns](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/hridayns/32/1222_2.png) [@hridayns](https://discuss.ray.io/u/hridayns)\
**Post date:** [December 21, 2023, 2:07pm UTC](https://discuss.ray.io/t/algo-train-calls-env-step-with-empty-action-object/11472/2 "2023-12-21T14:07:10Z")

</div>

Need to check your custom environment’s step() function. What are you returning there?
