Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronization Issue in ML-Agents Decision Timing #6175

Open
matinmoezzi opened this issue Nov 22, 2024 · 0 comments
Open

Synchronization Issue in ML-Agents Decision Timing #6175

matinmoezzi opened this issue Nov 22, 2024 · 0 comments
Labels
request Issue contains a feature request.

Comments

@matinmoezzi
Copy link

Is your feature request related to a problem? Please describe.
Yes, the problem arises from the desynchronization between the decision time (when Python produces an action) and Academy.EnvironmentStep() (when Unity applies actions). This desync can lead to duplicate actions being taken or duplicate states being read, which is frustrating when trying to maintain consistency and synchronization during training. The issue seems to stem from the non-blocking websocket communication between Unity and Python.

Describe the solution you'd like
I’d like a blocking mechanism in Unity that pauses rendering until the next action from Python is available. This would ensure that Academy.EnvironmentStep() only processes actions and states in sync with the decision-making process, preventing duplicates.

Describe alternatives you've considered

  • Increasing the frequency of EnvironmentStep() updates to match decision-making timing, but this doesn't fully address the synchronization issue.
  • Adjusting Time.timeScale and FixedUpdate() to better align the two processes, though this approach is limited by the non-blocking nature of the websocket mechanism.

Additional context
This issue is likely caused by the asynchronous nature of websocket-based communication. A blocking mechanism could help bridge the gap between Unity and Python processes. Feedback or alternative solutions from the community would be greatly appreciated.

@matinmoezzi matinmoezzi added the request Issue contains a feature request. label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request Issue contains a feature request.
Projects
None yet
Development

No branches or pull requests

1 participant