Search Unity

Adding behavioral cloning to previously trained agent

Discussion in 'ML-Agents' started by ZenUnity, Sep 13, 2020.

  1. ZenUnity

    ZenUnity

    Joined:
    Apr 21, 2013
    Posts:
    28
    I have an agent that has been trained for over 200M steps but I needed to makes some adjustments to the agents physics so it now needs some additional training to account for this. To help with training I added a demo file for behavioral cloning, but I'm getting the error "Make sure the model is from the same version of ML-Agents, has the same behavior parameters, and is using the same trainer configuration as the current run."

    I used bc in early trainings of this agent so I am surprised that adding it back in doesn't work. I've tested initializing from the earlier models where bc was enabled and it works just fine. I was under the impression that you can modify config files as long as there are no changes to the network settings.
     
  2. mbaske

    mbaske

    Joined:
    Dec 31, 2017
    Posts:
    473
    I've had a similar experience the other day. Apparently it isn't a problem to pause training, remove / comment out parts of the configuration and then resume. I started out with GAIL and BC, then for the second training phase, I switched to using extrinsic rewards exclusively which worked fine. However, I can't add BC or reward signals that weren't included in the configuration before.
    My workaround is to set strength values to 0 when I don't need the associated signals, but might have to include them again at some later point. That's not ideal though, it would be better if ML-Agents were more flexible in this regard. AFAIK, it's not an uncommon practice to split training into phases.
     
  3. ZenUnity

    ZenUnity

    Joined:
    Apr 21, 2013
    Posts:
    28
    I was considering doing the same thing going forward, glad to hear it sounds like you've had some success doing that. Though it won't work if I ever want to add in GAIL.

    Splitting up trainings has worked quite well for me up until this point and is actually quite necessary given that the game the agents are meant for is in active development. I'll add a feature request since other people might appreciate having this flexibility.
     
    Last edited: Sep 14, 2020
  4. andrewcoh_unity

    andrewcoh_unity

    Unity Technologies

    Joined:
    Sep 5, 2019
    Posts:
    162
    This is an issue with our tensorflow checkpointing. We are investigating possible solutions to this.
     
    DeshanGunarathna, mbaske and ZenUnity like this.