-1

The problem I have is that when I build my game with the brain set to "Internal" type and the graph model set, agent dose not move. But when I press the ▶️ button in Unity, agent moves.

I understand training method and I have graph model.

I want to move agent with .exe(build) file.

Development environment ・Windows 10 ・ml-agents v0.5.0 ・Unity 2018.2.18f1 Personal

1 Answers1

0

You are not very clear in what you have done or what your question is, but for using the internal brain, make sure you put your runid.bytes file inside the brain. Which is obtained after the training process has reached max_steps.

To train your agent with an executable file:

  1. Build your project
  2. Go to command line and go to the ml-agents folder on your computer. (Mine is located under C:/Users/alexl/ml-agents)
  3. Run mlagents-learn config/trainer_config.yaml --env="PATH/TO/EXE/EXE" --run-id=RUNID --train

Make sure to not include the file extension in path. For example C:/unityproject/project instead of C:/unityproject/project.exe

Now after the training process has finished, go to /ml-agents/models and here you will find a RUNID.bytes file. Put this into the internal brain and now press start in the Unity editor.

Noodles
  • 3,888
  • 2
  • 20
  • 31
  • Finally what I want to do is not inference with pressing start in the Unity editor and inputting command but inference with double-clicking .exe(build) file like an ordinary game. – miki kazuo Jan 06 '19 at 01:43
  • It's not exactly done by manually opening the .exe file, but the command in step 3 of my answer will run the .exe file and once you hit play it will behave the same way as it would in Unity. – Noodles Jan 06 '19 at 01:47
  • 1
    Exactly. But I want to use ML-Agents(internal brain) for my Indie game, so I need to make .exe(build) file and run ML-Agents(internal brain) in only .exe(build) file. – miki kazuo Jan 07 '19 at 15:45