Unity ML agents install

Installation

This should be completed by W8 – 26 Oct: Lab 5 – Connectionism. It shouldn’t take longer than 30m to do and we recommend starting as soon as possible so we can help you through any technical problems.

 

Windows Walkthrough

Mac Walkthrough

 

 

This is a modified version of the original unity ml installation instructions. This contains simplified instructions for how to install the required python packages.

The ML-Agents Toolkit contains several components:

  • Unity package (com.unity.ml-agents) contains the Unity C# SDK that will be integrated into your Unity scene.
  • Three Python packages:
    • mlagents contains the machine learning algorithms that enables you to train behaviors in your Unity scene. Most users of ML-Agents will only need to directly install mlagents.
    • mlagents_envs contains a Python API to interact with a Unity scene. It is a foundational layer that facilitates data messaging between Unity scene and the Python machine learning algorithms. Consequently, mlagents depends on mlagents_envs.
    • gym_unity provides a Python-wrapper for your Unity scene that supports the OpenAI Gym interface.
  • Unity Project that contains several example environments that highlight the various features of the toolkit to help you get started.

To install and use the ML-Agents Toolkit you will need to:

  • Install Python (3.6 or 3.7)
  • Install the mlagents Python package

Install Python 3.6.1 or Higher

We recommend installing Python 3.6 or 3.7. If you are using Windows, please install the x86-64 version and not x86.

  • Do NOT install Python 3.8 -> Unity does not support this and you may run into issues
  • Make sure to check off “Add to path” during the python installation

Although we do not provide support for Anaconda installation on Windows, the previous Windows Anaconda Installation (Deprecated) guide is still available.

Install the mlagents Python package

To install the mlagents Python package open your command prompt and type:

python -m pip install mlagents

or, if you have multiple verisons of python installed:

py -3.7 -m pip install mlagents

Note that this will install mlagents from PyPi, not from the cloned repository. If you installed this correctly, you should be able to run

mlagents-learn --help

, after which you will see the command line parameters you can use with mlagents-learn.

By installing the mlagents package, the dependencies listed in the setup.py file are also installed. These include TensorFlow (Requires a CPU w/ AVX support).