Ml-agents: Not able to train the 3Dball

Created on 26 Nov 2018  路  15Comments  路  Source: Unity-Technologies/ml-agents

When I type the command: mlagents-learn mlagents/trainers/learn.py --run-id=cub_1 --train
in anaconda prompt it will show :

1
Then I click the button in the unity and in the anaconda prompt it will show
image
And in the Unity it will show
image
I follow the instruction on https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Getting-Started-with-Balance-Ball.md
I do not know what it is going wrong.

help-wanted

Most helpful comment

Make sure "control" is unchecked in ball3dacademy

All 15 comments

It looks like that the Ball3DBrain is set to Internal.
Make sure to set the BrainType to external.

@MarcoMeter I think I already changed it in the inspector.
image

UnityAgentsException: The Communicator was unable to connect. Please make sure the External process is ready to accept communication with Unity.

This error means Unity can't connect to your mlagents-learn process. You should run mlagents-learn first, and press the Play button when you see INFO:mlagents.envs:Start training by pressing the Play button in the Unity Editor.

Which version of Python are you using?
The doc says it supports Python 3.6.
https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Installation-Windows.md.

UnityAgentsException: The Communicator was unable to connect. Please make sure the External process is ready to accept communication with Unity.

This error means Unity can't connect to your mlagents-learn process. You should run mlagents-learn first, and press the Play button when you see INFO:mlagents.envs:Start training by pressing the Play button in the Unity Editor.

Which version of Python are you using?
The doc says it supports Python 3.6.
https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Installation-Windows.md.

I am using Python3.6.7 in the anaconda. @zongjingyao

Hello, I'm facing the same problem.

I'm using Python 3.6 installed with Anaconda.

TensorFlow package installed in Python.

TFSharp plugin installed.

Trying to teach the default 3DBall env.

Error when trying to teach via Play button in Unity:

UnityAgentsException: The Communicator was unable to connect. Please make sure the External process is ready to accept communication with Unity. MLAgents.Batcher.SendAcademyParameters (MLAgents.CommunicatorObjects.UnityRLInitializationOutput academyParameters) (at Assets/ML-Agents/Scripts/Batcher.cs:83) MLAgents.Academy.InitializeEnvironment () (at Assets/ML-Agents/Scripts/Academy.cs:320) MLAgents.Academy.Awake () (at Assets/ML-Agents/Scripts/Academy.cs:227)

Error when trying launching the build with Anaconda Prompt:

Inside build: Error inside Buildt
Inside build: Error inside Build with detail
Anaconda Prompt: Error in Anaconda Prompt
Anaconda Prompt: Error in Detail

Thanks in advance.

@tcy1998 It looks like in your case the command you're running is incorrect. Rather than a training configuration file like the one included with the repository. Try running with an appropriate configuration file and see if that fixes your issue.

@LokoGD Are you trying to train within the editor or from a build?

you are trying to run the training from the build but I think that you are expecting to train from the editor.

Your 1st mistake is taht you haven't provided direct path to trainer_config.yaml file but to the folder where this file is located only
and 2nd mistake is that you are trying to launch training on a build which I don't know you have made or moved to a proper directory.

Try this command:
mlagents-learn ml-agents-master\config\trainer_config.yaml --run-id=your_run_name --train

If everything is OK you should shortly after see a prompt telling you to hit play button in the Unity. If you hit play you should see game/gym running as well training process initiated and visible in conda.

Let me know if it helped.

you are trying to run the training from the build but I think that you are expecting to train from the editor.

Your 1st mistake is taht you haven't provided direct path to trainer_config.yaml file but to the folder where this file is located only
and 2nd mistake is that you are trying to launch training on a build which I don't know you have made or moved to a proper directory.

Try this command:
mlagents-learn ml-agents-master\config\trainer_config.yaml --run-id=your_run_name --train

If everything is OK you should shortly after see a prompt telling you to hit play button in the Unity. If you hit play you should see game/gym running as well training process initiated and visible in conda.

Let me know if it helped.
@oddEventHorizon It did help, but now I face the similar problem as the @LokoGD had. And I also do not know which button it ask me to click. Is the play button in the Unity? I have tried it, but it does not seems working.
capture
capture

image
image
dude :)

I have tried the button, but it still say that the environment wait too long to respond. Anyway, I used the old version of the ml-agents. And I could train the 3dball model now.@oddEventHorizon Thanks so much.

I think I figure it out now. I think the brain type in the ball3dacademy should be 3dballlearning instead of 3dballplayer.

Glad you've managed to resolve the problems you were running into tcy1998. I'm going to close this issue since it's completed but please feel free to reopen or start a new issue if you have any more trouble.

Make sure "control" is unchecked in ball3dacademy

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings