ml-agents/ml-agents-envs
Miguel Alonso Jr 6bb711f1b0
Fixed gha for move back to public repo. (#5838)
2022-12-05 11:49:42 -05:00
..
colabs
mlagents_envs Fixed gha for move back to public repo. (#5838) 2022-12-05 11:49:42 -05:00
tests pull development changes to `main` branch (#81) 2022-11-18 13:21:12 -08:00
README.md Dev rel20 post (#5827) 2022-11-22 16:40:09 -08:00
pydoc-config.yaml pull development changes to `main` branch (#81) 2022-11-18 13:21:12 -08:00
setup.py pull development changes to `main` branch (#81) 2022-11-18 13:21:12 -08:00

README.md

Unity ML-Agents Python Interface

The mlagents_envs Python package is part of the ML-Agents Toolkit. mlagents_envs provides three Python APIs that allows direct interaction with the Unity game engine:

  • A single agent API (Gym API)
  • A gym-like multi-agent API (PettingZoo API)
  • A low-level API (LLAPI)

The LLAPI is used by the trainer implementation in mlagents. mlagents_envs can be used independently of mlagents for Python communication.

Installation

Install the mlagents_envs package with:

python -m pip install mlagents_envs==0.30.0

Usage & More Information

See

for more information on how to use the API to interact with a Unity environment.

For more information on the ML-Agents Toolkit and how to instrument a Unity scene with the ML-Agents SDK, check out the main ML-Agents Toolkit documentation.

Limitations

  • mlagents_envs uses localhost ports to exchange data between Unity and Python. As such, multiple instances can have their ports collide, leading to errors. Make sure to use a different port if you are using multiple instances of UnityEnvironment.
  • Communication between Unity and the Python UnityEnvironment is not secure.
  • On Linux, ports are not released immediately after the communication closes. As such, you cannot reuse ports right after closing a UnityEnvironment.