Skip to content

Commit 6b319c3

Browse files
committed
Modified the documentation with more detailed installation steps
1 parent 662d1a9 commit 6b319c3

File tree

1 file changed

+47
-5
lines changed

1 file changed

+47
-5
lines changed

Documentation~/README.md

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,64 @@ This package is available as a preview, so it is not ready for production use. T
33

44
## Installation
55

6+
### Install C# code
67
* Create a new Project on Unity 2019.3.0f5
78
* To your `Package/manifest.json` add the packages :
89
```json
9-
"com.unity.ai.mlagents": "https://github.com/Unity-Technologies/ml-agents-dots.git#master",
10+
"com.unity.ai.mlagents": "https://github.com/Unity-Technologies/ml-agents-dots.git#release-0.2.0",
1011
"com.unity.physics": "0.2.4-preview",
1112
"com.unity.rendering.hybrid": "0.3.3-preview.11",
1213
"com.unity.burst":"1.3.0-preview.2",
1314
"com.unity.test-framework.performance": "1.3.3-preview",
1415
"com.unity.coding": "0.1.0-preview.13"
1516
```
16-
and add the registry :
17-
```json
18-
"registry": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates",
19-
```
2017
* In the Package Manager window, select DOTS ML-Agents and import the Samples you need.
2118

19+
### Install Python code
20+
* Clone this repository in a new folder
21+
* Checkout release-0.2.0
22+
* run the following command inside the repository:
23+
```
24+
pip3 install -e ./ml-agents-envs~
25+
```
26+
27+
### Install trainer code
28+
* ML-Agents on DOTS is compatible with version 0.15.1 of the [ml-agents packages](https://github.com/Unity-Technologies/ml-agents/blob/0.15.1). Checkout the ml-agents repository on version 0.15.1
29+
* Run these commands at its root.
30+
```
31+
pip3 install -e ./ml-agents-envs
32+
pip3 install -e ./ml-agents
33+
```
34+
* Modify `./ml-agents/mlagents/trainers/learn.py` :
35+
Replace line 24:
36+
```python
37+
from mlagents_envs.environment import UnityEnvironment
38+
```
39+
with
40+
```python
41+
from mlagents_dots_envs.unity_environment import UnityEnvironment
42+
```
43+
* Similarly, modify `./ml-agents/mlagents/trainers/subprocess_env_manager.py` :
44+
Replace line 4:
45+
```python
46+
from mlagents_envs.environment import UnityEnvironment
47+
```
48+
with
49+
```python
50+
from mlagents_dots_envs.unity_environment import UnityEnvironment
51+
```
52+
53+
54+
## Train a sample
55+
* In Unity, open the 3DBall scene in the Samples
56+
* From the ml-agents repository root, call
57+
```
58+
mlagents-learn --train config/trainer_config.yaml
59+
```
60+
and press play in the Editor.
61+
If the installation was successful, you should see in the `Ball_DOTS` training results.
62+
63+
2264
## API
2365
One approach to designing ml-agents to be compativle with DOTS would be to use typical API used for example in [Unity.Physics](https://github.com/Unity-Technologies/Unity.Physics) where a "MLAgents World" holds data, processes it and the data can then be retrieved.
2466
The user would access the `MLAgentsWorld` in the main thread :

0 commit comments

Comments
 (0)