Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Error while loading a model with MLAgents

Discussion in 'ML-Agents' started by Celestin74, May 8, 2021.

  1. Celestin74

    Celestin74

    Joined:
    Feb 19, 2021
    Posts:
    1
    Hello everyone,

    I am trying to develop an agent to play my game for a school project and i decided to use MLAgents.

    I think that my scripts are okay, the learning process goes pretty well, the agent's behaviour changes with time. But when I try to load the generated model, I get this error message :

    UnityAgentsException Unknown tensorProxy expected as input : obs_0

    I don't really understand the script from which the error is thrown so I don't know how to fix it...

    Could anyone help me understand my problem ?
     
    ShinyMetagross and tobhil98 like this.
  2. shubhamm

    shubhamm

    Joined:
    Apr 21, 2013
    Posts:
    6
    Getting same issue when using model

    EDIT: Fixed via updating the MLAgents plugin to latest version available
     
    Last edited: May 9, 2021
    kenthalazo likes this.
  3. tobhil98

    tobhil98

    Joined:
    Apr 28, 2020
    Posts:
    1
    I was also having this issue. For me the latest version of ML-agent for Unity available in the packet manager was different from the latest version for Python. As I was using v1.9.1 in Unity, I had to install v0.25.1 using pip.

    python -m pip install mlagents==0.25.1
    https://github.com/Unity-Technologies/ml-agents/releases
     
  4. christophergoy

    christophergoy

    Joined:
    Sep 16, 2015
    Posts:
    735
    Hi @Celestin74,
    Could you help us out by giving us the following information:

    Unity Editor Version:
    com.unity.ml-agents (c# package) version:
    mlagents pip version:
    Operating System:
    Operating System Version:



    Thank you.
     
  5. justthatrio

    justthatrio

    Joined:
    Apr 26, 2020
    Posts:
    3
    I'm having the same problem
     
  6. Shachartz0

    Shachartz0

    Joined:
    Dec 28, 2020
    Posts:
    13
    I'm also having this problem
     
    ShinyMetagross likes this.
  7. steliosstavroulakis

    steliosstavroulakis

    Joined:
    Jun 16, 2021
    Posts:
    1
  8. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,817
    Hey all, could you please provide the information that @christophergoy requested. This will help with the troubleshooting process.
     
  9. unity_KLb5YtVHF55zzA

    unity_KLb5YtVHF55zzA

    Joined:
    Jun 3, 2018
    Posts:
    1
    Same error
     
    ShinyMetagross likes this.
  10. XRR422

    XRR422

    Joined:
    Jul 26, 2021
    Posts:
    3
    Hi mate,

    I have same problem; here is my information
    Unity Editor Version:2019.4.25f1
    com.unity.ml-agents (c# package) version: MLAgents 1.9.1-pre (I get this information by my Package Manager in Unity. If not correct please let me know)
    mlagents pip version: mlagents 0.28.0.dev0 (I get this information by checking my current conda list. if not current please let me know)
    Operating System:Mac OS Big Sur 11.4
    Operating System Version:Mac OS Big Sur 11.4

    If you have any further request please let me know. Thanks for your help!!
     
    mp20022013 likes this.
  11. unity_GELnPKgBkcda0g

    unity_GELnPKgBkcda0g

    Joined:
    Jul 22, 2020
    Posts:
    1
    Had the same problem, but I saw this https://github.com/Unity-Technologies/ml-agents/releases

    I had version 1.9.1 for unity package but 27.0 for python. Had to download 2.1 preview for Unity.

    On each release there is a Note that says they encourage to download the packages from the same release.
     
  12. XRR422

    XRR422

    Joined:
    Jul 26, 2021
    Posts:
    3

    Hi mate, I do not quite understand that. I download the Ml-agent package from the package manager implemented in Unity. It does not be limited by any release version 0.0;
     
  13. christophergoy

    christophergoy

    Joined:
    Sep 16, 2015
    Posts:
    735
    Hi @XRR422,
    Please update your ml-agents unity package. @unity_GELnPKgBkcda0g is correct. If you look at the github release page there are tables for all of the versions that work together. Please reference this next time. According to our own release page, the last release was Release 18. The unity package was at version 2.1.0-exp.1, and the python package at 0.27.0.

    You have an out-of-date unity package that was bumped up a major version and does not work with the version of python that you are using.
     
  14. XRR422

    XRR422

    Joined:
    Jul 26, 2021
    Posts:
    3
    Thank you Christophergoy and @unity_GELnPKgBkcda0g. It solves my problem after I update my python package to 0.27.0, and update mlagent to 2.1.0-exp.1 .
     
  15. RyukTheBear

    RyukTheBear

    Joined:
    Aug 17, 2021
    Posts:
    1
    Thanks to all, I had the same Issue and updating python + mlagents to those versions solved it for me!
     
  16. GabrielVianna

    GabrielVianna

    Joined:
    Nov 19, 2021
    Posts:
    2
    Hi, can anyone tell me how to make this updates? I'm having trouble to update my python package and mlagents
     
    kenthalazo likes this.
  17. kenthalazo

    kenthalazo

    Joined:
    Mar 4, 2022
    Posts:
    4
    Absolutely, Seems like compatibility errors and nothing more
     
  18. kenthalazo

    kenthalazo

    Joined:
    Mar 4, 2022
    Posts:
    4
    You can update in the command prompt inside the venv the mlagents using pip
    Then using the package manager choose the highest ver.