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

Enviroment Executable Not Training #6186

Open
ylcprog opened this issue Jan 10, 2025 · 0 comments
Open

Enviroment Executable Not Training #6186

ylcprog opened this issue Jan 10, 2025 · 0 comments
Labels
bug Issue describes a potential bug in ml-agents.

Comments

@ylcprog
Copy link

ylcprog commented Jan 10, 2025

I have ml-agents up and running. When I run mlagents-learn from the command line, and play the game from the Unity Editor - everything works fine (the agent trains). But when I build the game and try to run mlagents on the executable - no training is preformed.
In fact, I believe the python script is getting stuck - I think it runs the game, but never returns to continue executing the code. I have checked this by writing a simple python script to open the game and debug it:

from mlagents_envs.environment import UnityEnvironment
env = UnityEnvironment(file_name=path)
print("yay")

I ran this code on my executable, and the print command was never reached.
I know the problem isn't with python, because I managed to get it to work with executables I found online:

In addition, I know the problem is not with the game, because I ran into these problems also with the 3DBall example, and the very simple ball and plane example (https://unity-technologies.github.io/ml-agents/Learning-Environment-Create-New/). Same problem each time: Training works in the editor, but not with the executable.

I suspect something is wrong with the build process, but I don't know what. I followed the instructions here: https://unity-technologies.github.io/ml-agents/Learning-Environment-Executable/
I have selected "Run In Background" in the Player Settings, I have tried with and without "Development Build" - all without success.
After hours spent on this issue, I decided to try my luck with posting a bug...
Any help will be appriciated!

The training stuck:
Image

Environment:

  • Unity Version: I have tried with 2022.3.7f1, and with 6000.0.31f1
  • OS + version: Windows 10.
  • ML-Agents version: latest develop branch from source - branch 22, mlagents 1.1.0
  • Enviroment: 3DBall and simple example
@ylcprog ylcprog added the bug Issue describes a potential bug in ml-agents. label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue describes a potential bug in ml-agents.
Projects
None yet
Development

No branches or pull requests

1 participant