Search Unity

Question Agent kept moving although there was EndEpisode() there.

Discussion in 'ML-Agents' started by SkeVinc1, Jan 15, 2023.

  1. SkeVinc1

    SkeVinc1

    Joined:
    Oct 29, 2022
    Posts:
    4
    Recently, I'm training my robot arm agent. In one if sentence, I just let it print a message and then EndEpisode(). However, the result shows that although the message was printed, the robot arm didn't stop moving correspondingly but kept moving for a little bit while. I'm wondering why, isn't the agent stops moving immediately when it sees EndEpisode()??
    Thank you!!
     
  2. smallg2023

    smallg2023

    Joined:
    Sep 2, 2018
    Posts:
    147
    can you explain what you mean by "kept moving" - it'll stop making agent actions yes but rigidbody velocity and script updates etc will still be taking place
     
    SkeVinc1 likes this.
  3. SkeVinc1

    SkeVinc1

    Joined:
    Oct 29, 2022
    Posts:
    4
    Yeah, actually it was my fault. Since I've set up curriculum learning and in OnActionReceiver() I have if() else if() else if() else(), while in the first three parenthesis, I set environment parameter to 1, 2 and 3. Then, I discovered that when I loaded the onnx model, it actually went into the else(). So I set the parameter of the curriculum I want to run to 0 and it succeeded in Ending after printing out! Thanks.