Search Unity

Issues with MLAgents versions

Discussion in 'ML-Agents' started by Mixmix, Feb 7, 2020.

  1. Mixmix

    Mixmix

    Joined:
    Feb 7, 2020
    Posts:
    6
    Hi,
    I'm a beginner so bear with me. The issue I have is that whatever I do, I cannot get the latest version of MLAgents in my project. But that's my interpretation of what's happening, so I'm asking for your input.

    The actual problem I'm facing is that I cannot implement the CollectObservations(VectorSensor sensor) method as shown in the guide.
    Assets\Scripts\CarAgent.cs(61,46): error CS0246: The type or namespace name 'VectorSensor' could not be found (are you missing a using directive or an assembly reference?)

    and
    Assets\Scripts\CarAgent.cs(61,26): error CS0115: 'CarAgent.CollectObservations(VectorSensor)': no suitable method found to override

    are the errors I'm getting.
    Any ideas?
     
  2. celion_unity

    celion_unity

    Joined:
    Jun 12, 2019
    Posts:
    289
    Hi,
    This part of the documentation just changed on master yesterday; my guess is that your version of the code is older. Can you tell me what "k_ApiVersion" in Academy.cs is?

    I would recommend that you get the code and documentation from https://github.com/Unity-Technologies/ml-agents/tree/latest_release/ - this is the most recent official release of the code. The master branch is our main development branch, so it's constantly in flux.
     
  3. Mixmix

    Mixmix

    Joined:
    Feb 7, 2020
    Posts:
    6
    I did clone the repo with the --latest-release argument, as instructed in the guide, no luck there.
    I am now working on the 0.14 release which I manually downloaded, so api version is 0.14. The version in the link you sent me though says 0.13. I guess what I need is v0.15?

    Thank you for your time.
     
  4. davor115

    davor115

    Joined:
    Feb 9, 2020
    Posts:
    2
    Hi, I downloaded the newest version for the API and the "vector sensor" error got fixed.

    Problem is, when I try to train my agent using "mlagents-learn config/config.yaml --run-id=RollerBall-1 --train" I get that the API from the new version and from python don't match, which makes sense.
    ERROR LOG:
    The API number is not compatible between Unity and python. "
    mlagents_envs.exception.UnityEnvironmentException: The API number is not compatible between Unity and python. Python API: API-13, Unity API: API-15-dev0.

    Where I can get the latest version for python?
    Thanks in advance.
     
  5. Mixmix

    Mixmix

    Joined:
    Feb 7, 2020
    Posts:
    6
  6. davor115

    davor115

    Joined:
    Feb 9, 2020
    Posts:
    2
    Hi, Thanks for the answer.
    I did that which indeed it does update them to the 0.15 version. The problem I have is that, after doing that, if I try to run the code "mlagents-learn config/myTrainer.yaml --run-id=RollerBall-1 --train" from the environment. It outputs this error (image attached) .

    Any ideas how I could fix this?
    Thanks in advance.

    EDIT: Similar error happens if I just try mlagents-learn --help, now it just outputs errors rather than showing the right output.
     

    Attached Files:

    Last edited: Feb 9, 2020
  7. Mixmix

    Mixmix

    Joined:
    Feb 7, 2020
    Posts:
    6
    Maybe if you tried
    pip3 install setuptools --upgrade 
    ?
     
    davor115 likes this.
  8. celion_unity

    celion_unity

    Joined:
    Jun 12, 2019
    Posts:
    289
    Mixmix - 0.14.0 is not released yet (the branch you see is to get the release ready). We set the version on master to 0.15.0.dev0 after we branched for the 0.14.0 release. If you see "dev" on a version, it means you're working from master and not an official release.

    I strongly recommend that you
    * Install mlagents==0.13.1 from pip (and same for mlagents-envs)
    * Get the 0.13.1 version of the C# code from https://github.com/Unity-Technologies/ml-agents/tree/0.13.1/ (this is currently the same as the latest_release link)
    * Follow the docs from https://github.com/Unity-Technologies/ml-agents/tree/0.13.1/docs

    If you try to mix-and-match any of the versions and documentation, you're going to have problems.
     
    davor115 likes this.
  9. TheOz

    TheOz

    Joined:
    May 21, 2011
    Posts:
    34
    Hi Guys, I'm working with 0.14.1 ml-agents and the penguin demo. I can't seem to get around the PenguinAcademy override of InitializeAcademy() in the Academy.cs script. I didn't find anything in the migration notes. Does anyone have a quick fix for this?

    Garry
     
  10. Ishan_R

    Ishan_R

    Joined:
    Aug 26, 2019
    Posts:
    1
    Facing same issues as @TheOz . I just started Unity+ML. Please tell me what to do. Thank you
     

    Attached Files:

  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I'm seeing the same behavior using the latest ML-Agents, I have let the folks know at Immersive Limit LLC