Search Unity

Environment executable not responding

Discussion in 'ML-Agents' started by KNRichardson, Jul 28, 2020.

  1. KNRichardson

    KNRichardson

    Joined:
    Jul 20, 2020
    Posts:
    6
    Hi,

    I was having a first go at building an environment executable and interacting with it using the Python API by following the instructions here https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Learning-Environment-Executable.md (replacing 3DBall with the environment example Basic). The executable I build works when double click on the file, however when I run

    from mlagents_envs.environment import UnityEnvironment
    env = UnityEnvironment(file_name=<env_name>)

    from the command-line, it returns
    Found path: /home/campus.ncl.ac.uk/b3024896/Projects/ml-agents/basictest.x86_64

    but the application produces a not responding force quit or wait pop up. Any help much appreciated, see below for more details. Thanks

    System and versions:
    Linux Ubuntu 18.04
    Unity 2019.4.4f1
    mlagents, mlagents-envs, gym-unity 0.18.0
    stable-baselines 2.10.0
    python 3.6

    Install process:
    Created project directory
    From here created pipenv with Python 3.6
    From here ran
    git clone --branch release_4 https://github.com/Unity-Technologies/ml-agents.git

    Installed the 'com.unity.ml-agents' package with editor package manager
    With pipenv active, installed mlagents and gym_unity with pip3 install

    Executable build:
    Opened Unity editor
    Navigated to 'Assets/ML-Agents/Examples/Basic/Scenes/' and opened the scene
    Ensured 'run in background' was checked in player settings
    Couldn't find 'display resolution dialogue' option but googled and apparently it is set to disabled by default now
    Went to build settings and selected 'PC, Mac & Linux Standalone' with development build selected



    Just to add:
    I looked at the log files at ~/.config/unity3d/CompanyName/ProductName/Player.log and I have multiple lines of the following at the end
    Fallback handler could not load library /home/campus.ncl.ac.uk/b3024896/Projects/ml-agents/basictest_Data/Mono/libcoreclr.so
     
    Last edited: Jul 28, 2020
  2. awjuliani

    awjuliani

    Unity Technologies

    Joined:
    Mar 1, 2017
    Posts:
    69
    Hello. Are you able to call env.reset after instantiating the environment? The executable being "frozen" is actually the expected behavior, as it is waiting on python for commands.
     
  3. KNRichardson

    KNRichardson

    Joined:
    Jul 20, 2020
    Posts:
    6
    Yes that's great! Thank you
     
  4. KNRichardson

    KNRichardson

    Joined:
    Jul 20, 2020
    Posts:
    6
    Any idea why I'm getting this syntax error?

    >>> mlagents-learn /config/ppo/Basic.yaml --env=Basic --run-id=firstRun
    File "<stdin>", line 1
    SyntaxError: can't assign to operator

    I've looked at the migration document outlining the format changes e.g. the move from trainer_config.yaml to example specific yaml files, I've looked at using the script upgrade_config.py but it returns an identical file so I think the format I have is up to date, I've tried taking the first line 'behavior:' out, I've tried uninstalling the PyPi installs and instead installing from the cloned repo. Can't figure it out.
     
  5. celion_unity

    celion_unity

    Joined:
    Jun 12, 2019
    Posts:
    289
  6. HarshaMusunuri

    HarshaMusunuri

    Joined:
    Jun 16, 2020
    Posts:
    2
    Hello, I did env.reset() it is still stuck on the black screen. Please help me :)