Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Port 5004 don't open ?

Discussion in 'ML-Agents' started by quocnam, Jun 29, 2020.

  1. quocnam

    quocnam

    Joined:
    Dec 2, 2016
    Posts:
    4
    I got the following message from system

    Couldn't connect to trainer on port 5004 using API version 1.0.0. Will perform inference instead. UnityEngine.Debug:Log(Object)

    How could I repair it ?
     
  2. ervteng_unity

    ervteng_unity

    Unity Technologies

    Joined:
    Dec 6, 2018
    Posts:
    150
    Are you using
    mlagents-learn
    and getting this message?:

    Listening on port 5004. Start training by pressing the Play button in the Unity Editor.
     
  3. quocnam

    quocnam

    Joined:
    Dec 2, 2016
    Posts:
    4
    tks! i will try
     
  4. Hsgngr

    Hsgngr

    Joined:
    Dec 28, 2015
    Posts:
    61
    If you are getting this message while you are developing your environment it is okay. Just ignore it. The port usage is about training the agents. You don't need to connect to the python api to work with agents. They have their pre-trained neural networks and these nn modesl are doing all the job. If you are still getting this message when you want to connect the port and train an agent it can cause a problem. Unless ignore it.

    To connect to the port, you need a command prompt which is in directory where your training_configuration yaml is. Then you can start the training by using:
    Code (CSharp):
    1. mlagents-learn ./trainer_config.yaml --run-id first_run
    Then you will see the Unity Logo and it will want from you to start the simulation on Unity Editor. Then your results should come like this:

    upload_2020-6-30_13-3-48.png