You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: com.unity.ml-agents/Documentation~/Installation.md
+72-45Lines changed: 72 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,53 +1,69 @@
1
1
# Installation
2
-
To install and use the ML-Agents Toolkit, follow the steps below. Detailed instructions for each step are provided later on this page.
2
+
Set up your system to use the ML-Agents Toolkit to train and evaluate machine-learning agents in Unity projects.
3
3
4
-
1. Install Unity (6000.0 or later)
5
-
2. Install Python using conda (>= 3.10.1, <=3.10.12) - we recommend using 3.10.12
6
-
3. Install ML-Agents using one of the following methods:
4
+
This process includes installing Unity, configuring Python, and installing the ML-Agents packages. Follow the steps in order to ensure compatibility between Unity and the ML-Agents components.
7
5
8
-
3.1 Package installation
9
6
10
-
3.2 Advanced installation
11
7
12
-
## 1. Install **Unity 6000.0** or Later
8
+
## Install Unity
13
9
14
-
[Download](https://unity3d.com/get-unity/download) and install Unity. We strongly recommend that you install Unity through the Unity Hub as it will enable you to manage multiple Unity versions.
10
+
Install Unity 6000.0 or later to use the ML-Agents Toolkit.
15
11
16
-
## 2. Install **Python 3.10.12** using Conda
12
+
To install Unity, follow these steps:
17
13
18
-
We recommend using [conda](https://docs.conda.io/en/latest/) or [mamba](https://github.com/mamba-org/mamba) to install and manage Python environments.
2. Use the Unity Hub to manage installations and versions.
16
+
Unity Hub makes it easier to manage multiple Unity versions and associated projects.
17
+
4. Verify that the Unity Editor version is 6000.0 or later.
19
18
20
-
Once conda has been installed on your system, open a terminal and execute the following commands to set up a Python 3.10.12 virtual environment and activate it:
Use Conda or Mamba to install and manage your Python environment. This ensures that ML-Agents dependencies are isolated and version-controlled.
25
22
26
-
On Windows, you'll have to install the PyTorch package separately prior to installing ML-Agents in order to make sure the cuda-enabled version is used, rather than the CPU-only version. Activate your virtual environment and run from the command line:
* Package installation: Recommended for most users who want to use ML-Agents without modifying the source code.
38
+
* Advanced installation: For contributors, developers extending ML-Agents, or users who want access to the example environments.
39
+
40
+
### Install ML-Agents (Package installation)
41
+
42
+
Use this method if you don’t plan to modify the toolkit or need the example environments.
43
+
44
+
#### Install the Unity package
45
+
46
+
To install the package, follow these steps:
47
+
48
+
1. In Unity, open **Window**>**Package Manager**.
49
+
2. Select **+**>**Add package by name**.
50
+
3. Enter `com.unity.ml-agents`.
51
+
4. Enable **Preview Packages** under the **Advanced** drop-down list if the package doesn’t appear.
31
52
32
-
Note that on Windows, you may also need Microsoft's Visual C++ Redistributable if you don't have it already. See the [PyTorch installation guide](https://pytorch.org/get-started/locally/) for more installation options and versions.
53
+
If the package isn’t listed, follow the [Advanced Installation](#32-install-ml-agents---advanced-installation) method instead.
33
54
34
55
35
-
## 3.1 Install ML-Agents - Package Installation
36
-
Use this installation method if you do not plan to modify or extend the ML-Agents Toolkit for your purposes and you don't need access to our example environments.
37
56
38
-
### 3.1.1 Install the `com.unity.ml-agents` Unity package
57
+
### Install the Python package
39
58
40
-
The Unity ML-Agents C# SDK is a Unity Package. You can install the `com.unity.ml-agents`package [directly from the Package Manager registry](https://docs.unity3d.com/Manual/upm-ui-install.html). Please make sure you enable 'Preview Packages' in the 'Advanced' dropdown in order to find the latest Preview release of the package.
59
+
Install the ML-Agents Python package to enablecommunication between Unity and your machine learning training environment.
41
60
42
-
**NOTE:** If you do not see the ML-Agents package listed in the Package Manager please follow the [Advanced Installation](#32-install-ml-agents---advanced-installation) instructions at the bottom of this page.
61
+
Using a Python virtual environment helps isolate project dependencies and prevent version conflicts across your system. Virtual environments are supported on macOS, Windows, and Linux. For more information, refer to [Using Virtual Environments](https://github.com/Unity-Technologies/ml-agents/pull/6242/files/Using-Virtual-Environment.md).
43
62
44
-
### 3.1.2 Install Python package
63
+
1. Before installing ML-Agents, activate the Conda environment you created:
45
64
46
-
Installing the `mlagents` Python package involves installing other Python packages that `mlagents` depends on. So you may run into installation issues if your machine has older versions of any of those dependencies already installed. Consequently, our supported path for installing `mlagents` is to leverage Python Virtual Environments. Virtual Environments provide a mechanism for isolating the dependencies for each project and are supported on Mac / Windows / Linux. We offer a dedicated [guide on Virtual Environments](Using-Virtual-Environment.md).
47
65
48
-
You can install the ML-Agents Python package directly from PyPi.
49
66
50
-
**Important:** Ensure you install a Python package version that matches your Unity package version. Check the [release history](https://github.com/Unity-Technologies/ml-agents/releases) to find compatible versions.
51
67
52
68
To install, activate your virtual environment and run the following command:
53
69
@@ -61,43 +77,54 @@ which will install the latest version of ML-Agents Python packages and associate
61
77
conda install "grpcio=1.48.2" -c conda-forge
62
78
```
63
79
64
-
When you install the Python package, the dependencies listed in the [setup.py file](https://github.com/Unity-Technologies/ml-agents/blob/release/4.0.0/ml-agents/setup.py) are also installed. These include [PyTorch](Background-PyTorch.md).
65
80
66
81
67
-
## 3.2 Install ML-Agents - Advanced Installation
82
+
### Install ML-Agents (Advanced Installation)
83
+
84
+
Use the advanced installation method if you plan to modify or extend the ML-Agents Toolkit, or if you want to download and use the example environments included in the repository.
85
+
86
+
#### Clone the ML-Agents repository
87
+
88
+
Clone the ML-Agents repository to access the source code, sample environments, and development branches.
89
+
90
+
To clone the latest stable release, run:
68
91
69
-
You will need to clone the repository if you plan to modify or extend the ML-Agents Toolkit for your purposes, or if you'd like to download our example environments. Some of our tutorials / guides assume you have access to our example environments.
The `--branch release_23` option will switch to the tag of the latest stable release. Omitting that will get the `develop` branch which is potentially unstable. However, if you find that a release branch does not work, the recommendation is to use the `develop` branch as it may have potential fixes for bugs and dependency issues.
78
99
79
-
To get the bleeding-edge development version (optional):
If you plan to contribute those changes back, make sure to clone the `develop` branch (by omitting `--branch release_23` from the command above). See our [Contributions Guidelines](CONTRIBUTING.md) for more information on contributing to the ML-Agents Toolkit.
102
+
#### Add the ML-Agents Unity package
103
+
104
+
After cloning the repository, add the `com.unity.ml-agents` Unity package to your project.
86
105
87
-
### 3.2.1 Add the `com.unity.ml-agents` Unity package
88
-
You can [add the local](https://docs.unity3d.com/Manual/upm-ui-local.html)`com.unity.ml-agents` package (from the repository that you just cloned) to your project by:
106
+
To add the local package, follow these steps:
89
107
90
-
1.Navigating to the menu `Window` -> `Package Manager`.
91
-
2. In the package manager window, click on the `+` button on the top left of the packages list.
92
-
3. Select `Add package from disk...`
93
-
4. Navigate into the `com.unity.ml-agents` folder.
108
+
1. In the Unity Editor, go to **Window**>**Package Manager**.
109
+
2. In the **Package Manager** window, select**+**.
110
+
3. Select **Add package from disk**.
111
+
4. Navigate to the cloned repository and open the `com.unity.ml-agents` folder.
94
112
5. Select the `package.json` file.
95
113
114
+
Unity adds the ML-Agents package to your project.
115
+
116
+
If you plan to use the example environments provided in the repository, open the **Project** folder in Unity to explore and experiment with them.
0 commit comments