Is it possible to train ml-agents on the built game (so outside the editor) without having the game binary being launched by ml-agents by specifying the --env variable. For example, the game gets to a particular scene in the game where the agents are trained.
This isn’t something we support right now - if you don’t specify --env, mlagents-learn will assume that you’re trying to connect to the editor, and only launch one environment that tries to connect on port 5004 by default.
I’m not sure how this would work in practice - currently the Unity plugin tries to connect to the trainer on a port when it starts up, but if that’s no available, it uses inference. You could potentially destroy and recreate the Academy instance whenever you wanted to try reconnecting, but that assumes you have a trainer running and listening on the right port too. You’d also probably need to use a very long timeout on the trainer side, since it will likely be waiting for a long time for something to connect to it.
1 Like