Search Unity

ML-Agents Package Settings - available in Player?

Discussion in 'ML-Agents' started by JezMK, Aug 13, 2021.

  1. JezMK

    JezMK

    Joined:
    Mar 19, 2021
    Posts:
    5
    Hi friends,

    So, I'm wanting to use the package settings to run training sessions on a build server, while also still being able create a release build with an inference-only agent. I was planning on toggling the ML-Agent package setting, in the build process, however I've come across a few hurdles:

    In the docs, it states that it can be used in both editor and player. I assume this means in a build, however, investigating the Academy code it seems that this setting is only ever applied in the unity editor? Even worse, the academy tries to read from the command-line, regardless of whether this setting is checked or not, or if inference is being attempted.
    I would prefer to not read from the command line in a release build, even if it is on a secure server, but this doesn't seem possible at the moment.

    Is my understanding correct, that the package manager settings are purely for editor purposes?
    Also, is the academy is required to run inference, which will always try to read input from CMD-line as part of its initialisation?

    Thanks in advance,
    Jez
     
  2. ruoping_unity

    ruoping_unity

    Unity Technologies

    Joined:
    Jul 10, 2020
    Posts:
    134
    Hi @JezMK ,

    Thanks for raising this, we didn't realize this would be confusing to users. I think the confusion comes from the fact that we allow CLI to have higher priority to overwrite package settings so we check the CLI args anyway. So the reason you saw the setting only used for editor is because in player build it's default to not to connect unless when you specify in CLI.

    But I totally agree with you that this is not really expected according to the docs and we should provide an option to run inference only without even try to connect for production use. I'll log this request to our internal system.

    To your question, yes academy is required to run inference since it orchestrate all the environment stepping and when agents request/execute action, but we should be able to disable the part for reading args from CLI.
     
    JezMK likes this.
  3. JezMK

    JezMK

    Joined:
    Mar 19, 2021
    Posts:
    5
    Thanks @ruoping_unity! I'm looking forward to the production-only inference option :)