Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question Can I train an agent with inference of an already trained onnx file?

Discussion in 'ML-Agents' started by wechat_os_Qy04BvVNUR3eaTYQMAQb2l6Cg, Dec 18, 2021.

  1. wechat_os_Qy04BvVNUR3eaTYQMAQb2l6Cg

    wechat_os_Qy04BvVNUR3eaTYQMAQb2l6Cg

    Joined:
    Jul 31, 2021
    Posts:
    2
    I am working on a project of jet fighters, and I want my agent to learn how to act based on the previous training.
    I have trained my agents how to fly towards the target, but I wonder whether I can use this trained onnx file to give inferenece of the new training which let the agent learn how to avoid barriers. OR I have to use curriculum training methods.(Plus: I added some ray cast sensors to the agents for the new training)
    Thank you!
     
  2. jrupert-unity

    jrupert-unity

    Unity Technologies

    Joined:
    Oct 20, 2021
    Posts:
    12
    I'm not sure how well loading an onnx file back into pytorch will work, but you can use the mlagents-learn --resume option to continue training starting with the learning parameters you have using the last pytorch checkpoint.

    If the environment or rewards have changed this amounts to a manual curriculum, but having a scripted curriculum is a good idea so that you can repeat the process again if necessary. If you've added new observations since training the model it is probably best to retrain it over again.
     
  3. wechat_os_Qy04BvVNUR3eaTYQMAQb2l6Cg

    wechat_os_Qy04BvVNUR3eaTYQMAQb2l6Cg

    Joined:
    Jul 31, 2021
    Posts:
    2
    You have made it very clear, I think I understand how to proceed . Thank you!