# Marwil : Postprocessing of multi-agent data not implemented yet

**URL:** <https://discuss.ray.io/t/marwil-postprocessing-of-multi-agent-data-not-implemented-yet/5673>\
**Category:** RLlib\
**Created:** [April 4, 2022, 3:19pm UTC](https://discuss.ray.io/t/marwil-postprocessing-of-multi-agent-data-not-implemented-yet/5673 "2022-04-04T15:19:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clement\_Collgon](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/clement_collgon/32/353_2.png) [@Clement\_Collgon](https://discuss.ray.io/u/Clement_Collgon)\
**Post date:** [April 4, 2022, 3:19pm UTC](https://discuss.ray.io/t/marwil-postprocessing-of-multi-agent-data-not-implemented-yet/5673/1 "2022-04-04T15:19:11Z")

</div>

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

- Medium: It contributes to significant difficulty to complete my task, but I can work around it.

In MARWIL, it is said on main page that multi-agent is supported. However, when I feed a MultiAgentBatch, I get the following exception with \_postprocess\_if\_needed :

raise NotImplementedError(  
“Postprocessing of multi-agent data not implemented yet.”)

Beta is obviously \> 0 (=0 is just BC), and when you want to work with a positive beta, it is mandatory to have a postprocessing. Is there a way to fix this easily? For now, I replaced locally the error with “return batch” and it seems to be working fine… My advantages are already calculated in my JSONs after all?

Thanks

---

<div class="post-metadata">

**Author:** ![Clement\_Collgon](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/clement_collgon/32/353_2.png) [@Clement\_Collgon](https://discuss.ray.io/u/Clement_Collgon)\
**Post date:** [April 5, 2022, 9:28am UTC](https://discuss.ray.io/t/marwil-postprocessing-of-multi-agent-data-not-implemented-yet/5673/2 "2022-04-05T09:28:18Z")

</div>

If anyone one day wants to hack the current rllib implementation, you can use this in json\_reader.py, l. 135 :

```
    else:
        # TODO(ekl) this is trickier since the alignments between agent
        # trajectories in the episode are not available any more.
        # raise NotImplementedError(
        # "Postprocessing of multi-agent data not implemented yet.")
        policy_batches = {}
        for agent in list(batch.policy_batches.keys()):
            out = []
            for sub_batch in batch.policy_batches[agent].split_by_episode():
                out.append(self.ioctx.worker.policy_map.get(agent).postprocess_trajectory(sub_batch))
            policy_batches[agent] = SampleBatch.concat_samples(out)

        processed_batch = MultiAgentBatch(policy_batches, env_steps=batch.count)
        return processed_batch

```

seems to be doing ok.
