Search Unity

Bug mlagents-learn command and agents that are not in the scene in the first frame

Discussion in 'ML-Agents' started by xYuye, Nov 28, 2023.

  1. xYuye

    xYuye

    Joined:
    Mar 24, 2016
    Posts:
    4
    Hi,

    I am having problems because my agent with the BehaviourParameters component is not by default in the game scene.

    First I generate the world and navMesh, then I spawn the agent and programmatically add the BehaviourParamater component and its specifications later. Hence, when I run mlagents-learn, it creates a model with empty observation and action spaces, which causes errors as it returns nulls.

    How can I solve this? Ideally, I would delay the model creation and the entire mlagents-learn pipeline until the agent is spawned in the game.

    Thank you!