[RLlib][Unity3D] multi_agent_episode.py
raised exception : did NOT receive a last (truncation) observation
#49381
Labels
P1
Issue that should be fixed within a few weeks
rllib
RLlib related issues
rllib-client-server
Issue related to RLlib's client/server API.
rllib-env
rllib env related issues
rllib-newstack
What happened + What you expected to happen
The following two expections in
multi_agent_episode.py
can be raised when training with theUnity3DEnv
.ray/rllib/env/multi_agent_episode.py
Lines 543 to 547 in 29e6029
ray/rllib/env/multi_agent_episode.py
Lines 587 to 592 in 29e6029
This issue occurs because the
ML-Agents
'UnityEnvironment.get_steps(...)
function doesn't always return steps of all the agents at every timestep.Example:
Consider the
3DBall
environment inML-Agents
, which has 12 agents in the scene.Ideally,
get_steps(...)
should the steps for all the agents in either thedeicision_steps
orterminal_steps
.However, occasionally, it may only return steps of some agents.
These exceptions occur if Unity doesn't return steps for all agents when our
episode_timesteps
reaches theepisode_horizon
.ray/rllib/env/wrappers/unity3d_env.py
Lines 181 to 188 in 29e6029
Versions / Dependencies
Ray 2.40 (main)
Reproduction script
To reproduce this issue, train using the
3DBall
environment fromML-Agents
. Lowering theepisode_horizon
parameter in the constructor of Unity3DEnv can increase the likelihood of encountering the problem.Issue Severity
Medium: It is a significant difficulty but I can work around it.
The text was updated successfully, but these errors were encountered: