Skip to content

Commit bb4f061

Browse files
committed
Update markdown file
1 parent 06f857b commit bb4f061

File tree

1 file changed

+30
-31
lines changed

1 file changed

+30
-31
lines changed

com.unity.ml-agents/Documentation~/Installation.md

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,49 @@ To install and use the ML-Agents Toolkit, follow the steps below. Detailed instr
33

44
1. Install Unity (6000.0 or later)
55
2. Install Python using conda (>= 3.10.1, <=3.10.12) - we recommend using 3.10.12
6-
3. Install the `com.unity.ml-agents` Unity package
7-
4. Install `mlagents-envs`
8-
5. Install `mlagents`
6+
3. Install ML-Agents using one of the following methods:
97

10-
### Install **Unity 6000.0** or Later
8+
3.1 Package installation
9+
10+
3.2 Advanced installation
11+
12+
## 1. Install **Unity 6000.0** or Later
1113

1214
[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.
1315

14-
### Install **Python 3.10.12** using Conda
16+
## 2. Install **Python 3.10.12** using Conda
1517

1618
We recommend using [conda](https://docs.conda.io/en/latest/) or [mamba](https://github.com/mamba-org/mamba) to install and manage Python environments.
1719

18-
Once conda has been installed on your system, open a terminal and execute the following commands to setup a Python 3.10.12 virtual environment and activate it:
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:
1921

2022
```shell
2123
conda create -n mlagents python=3.10.12 && conda activate mlagents
2224
```
2325

24-
### Install the `com.unity.ml-agents` Unity package
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:
27+
28+
```sh
29+
pip3 install torch~=2.2.1 --index-url https://download.pytorch.org/whl/cu121
30+
```
31+
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.
33+
34+
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+
38+
### 3.1.1 Install the `com.unity.ml-agents` Unity package
2539

2640
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.
2741

28-
**NOTE:** If you do not see the ML-Agents package listed in the Package Manager please follow the [Advanced Installation](#advanced-installation) instructions at the bottom of this page.
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.
2943

30-
### Install Python package
44+
### 3.1.2 Install Python package
3145

3246
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).
3347

34-
#### Installing `mlagents` from PyPi
35-
36-
You can install the ML-Agents Python package directly from PyPi. This is the recommended approach if you installed the C# package via the Package Manager registry.
48+
You can install the ML-Agents Python package directly from PyPi.
3749

3850
**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.
3951

@@ -52,9 +64,7 @@ conda install "grpcio=1.48.2" -c conda-forge
5264
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).
5365

5466

55-
## Advanced Installation
56-
57-
### Unity Package: Local Installation for Development
67+
## 3.2 Install ML-Agents - Advanced Installation
5868

5969
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.
6070

@@ -66,18 +76,19 @@ git clone --branch release_23 https://github.com/Unity-Technologies/ml-agents.gi
6676

6777
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.
6878

69-
(Optional to get bleeding edge)
79+
To get the bleeding-edge development version (optional):
7080

7181
```sh
7282
git clone https://github.com/Unity-Technologies/ml-agents.git
7383
```
7484

7585
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.
7686

87+
### 3.2.1 Add the `com.unity.ml-agents` Unity package
7788
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:
7889

79-
1. navigating to the menu `Window` -> `Package Manager`.
80-
2. In the package manager window click on the `+` button on the top left of the packages list).
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.
8192
3. Select `Add package from disk...`
8293
4. Navigate into the `com.unity.ml-agents` folder.
8394
5. Select the `package.json` file.
@@ -86,19 +97,7 @@ You can [add the local](https://docs.unity3d.com/Manual/upm-ui-local.html) `com.
8697

8798
If you are going to follow the examples from our documentation, you can open the `Project` folder in Unity and start tinkering immediately.
8899

89-
### Python Package: Local Installation for Development
90-
91-
#### (Windows) Installing PyTorch
92-
93-
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:
94-
95-
```sh
96-
pip3 install torch~=2.2.1 --index-url https://download.pytorch.org/whl/cu121
97-
```
98-
99-
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.
100-
101-
#### All Platforms
100+
### 3.2.2 Install Python package
102101

103102
To install the `mlagents` Python package, activate your virtual environment and run from the command line:
104103

0 commit comments

Comments
 (0)