Environment executable not responding

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 ml-agents/docs/Learning-Environment-Executable.md at main · Unity-Technologies/ml-agents · GitHub (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

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.

Yes that’s great! Thank you

Any idea why I’m getting this syntax error?

mlagents-learn /config/ppo/Basic.yaml --env=Basic --run-id=firstRun
File “”, 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.

Moving this discussion to Syntax error: can't assign to operator when training with executable

Hello, I did env.reset() it is still stuck on the black screen. Please help me :slight_smile:

1 Like