2

I'm using Unity3D ML-Agents and when running examples of multiple clones inside(3DBall for example), there is a message in the console says:

Couldn't connect to trainer on port 5004 using API version API-13. Will perform inference instead. UnityEngine.Debug:Log(Object) MLAgents.Academy:InitializeEnvironment() (at Assets/ML-Agents/Scripts/Academy.cs:228) MLAgents.Academy:LazyInitialization() (at Assets/ML-Agents/Scripts/Academy.cs:147) MLAgents.Agent:OnEnable() (at Assets/ML-Agents/Scripts/Agent.cs:255)

I tried to turn off the firewall but it didn't work. How can I solve it?

The version I'm using is

Unity 2018.4.14f1, 
ml-agents: 0.13.0,   
ml-agents-envs: 0.13.0,  
Communicator API: API-13,   
TensorFlow: 1.7.1
RoxaneY
  • 23
  • 3

1 Answers1

1

This is just a normal warning that tells you that you won't train but instead use an already trained version in the environment(s). You don't need to worry about this. I assume your environment works when you start it.

If you really want to turn this off, you can go to the agent object and look for the 'Behavior Parameters' -> 'Behavior Type' then set this value to "Inference". Make sure to set it back to default when you want to train your agents.

enter image description here

If you want a good introduction to MLAgents, make sure to check out my YouTube ML-Agents Playlist

Edit: I just saw that you're using a beta version. Make sure to use at least version 0.16.0. Probably just going through my first video would be the best idea to get you started.

  • This error means you cannot use keyboard input, so not something you can just ignore if you want to test or train your system. – Brian Dolan Apr 20 '21 at 02:04
  • I try to ignore the error but it blocks the game for 15 seconds, how do I use a ML agent in a actual game without having to wait for the delay? Every model I load takes 15 seconds to wait for training to communicate. But I already have trained nets and now only try to load the NNmodel from a file, but always there is a 15 second delay followed by warning saying the trainer did not connect, but training is undesired in the final game build. – Logic1 Aug 09 '23 at 17:23