Skip to content

Commit ba79dd2

Browse files
author
Marwan Mattar
authored
Merge pull request #553 from palomagr/patch-1
Update Installation for windows
2 parents ee366ff + e4d76ab commit ba79dd2

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

docs/Getting-Started-with-Balance-Ball.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ To summarize, go to your command line, enter the `ml-agents` directory and type:
272272
```python
273273
python3 python/learn.py <env_file_path> --run-id=<run-identifier> --train
274274
```
275+
**Note**: If you're using Anaconda, don't forget to activate the ml-agents environment first.
275276

276277
The `--train` flag tells ML-Agents to run in training mode. `env_file_path` should be the path to the Unity executable that was just created.
277278

@@ -316,6 +317,7 @@ during a successful training session.
316317
Once the training process completes, and the training process saves the model
317318
(denoted by the `Saved Model` message) you can add it to the Unity project and
318319
use it with agents having an **Internal** brain type.
320+
**Note:** Do not just close the Unity Window once the `Saved Model` message appears. Either wait for the training process to close the window or press Ctrl+C at the command-line prompt. If you simply close the window manually, the .bytes file containing the trained model is not exported into the ml-agents folder.
319321

320322
### Setting up TensorFlowSharp Support
321323

docs/Installation-Windows.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ To use ML-Agents, you install Python and the required Python packages as outline
66

77
## Step 1: Install Python via Anaconda
88

9-
[Download](https://www.anaconda.com/download/#windows) and install Anaconda for Windows. By using Anaconda, you can manage separate environments for different distributions of Python. Python 3 is required as we no longer support Python 2. In this guide, we are using Python version 3.6 and Anaconda version 5.1 ([64-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86_64.exe) or [32-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86.exe) direct links).
9+
[Download](https://www.anaconda.com/download/#windows) and install Anaconda for Windows. By using Anaconda, you can manage separate environments for different distributions of Python. Python 3 is required as we no longer support Python 2. In this guide, we are using Python version 3.5 (Anaconda comes with Python 3.6, we will create an environment with python 3.5) and Anaconda version 5.1 ([64-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86_64.exe) or [32-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86.exe) direct links).
1010

1111
<p align="center">
1212
<img src="images/anaconda_install.PNG"
@@ -23,15 +23,21 @@ We recommend the default _advanced installation options_. However, select the op
2323
</p>
2424

2525
After installation, you must open __Anaconda Navigator__ to finish the setup. From the Windows search bar, type _anaconda navigator_. You can close Anaconda Navigator after it opens.
26-
26+
If environment variables were not created, or if you see the error "conda is not recognized as internal or external command", in System Variables, "Path" add the following new paths:
27+
```
28+
C:\ProgramData\Anaconda3\Scripts
29+
C:\ProgramData\Anaconda3\Scripts\conda.exe
30+
C:\ProgramData\Anaconda3
31+
C:\ProgramData\Anaconda3\python.exe
32+
```
2733
## Step 2: Setup and Activate a New Conda Environment
2834

2935
You will create a new [Conda environment](https://conda.io/docs/) to be used with ML-Agents. This means that all the packages that you install are localized to just this environment. It will not affect any other installation of Python or other environments. Whenever you want to run ML-Agents, you will need activate this Conda environment.
3036

3137
To create a new Conda environment, open a new Anaconda Prompt (_Anaconda Prompt_ in the search bar) and type in the following command:
3238

3339
```
34-
conda create -n ml-agents python=3.6
40+
conda create -n ml-agents python=3.5
3541
```
3642

3743
You may be asked to install new packages. Type `y` and press enter _(make sure you are connected to the internet)_. You must install these required packages. The new Conda environment is called ml-agents and uses Python version 3.6.
@@ -50,10 +56,10 @@ conda activate ml-agents
5056

5157
You should see `(ml-agents)` prepended on the last line.
5258

53-
Next, install `tensorflow`. Install this package using `pip` - which is a package management system used to install Python packages. In the same Anaconda Prompt, type in the following command _(make sure you are connected to the internet)_:
59+
Next, install `tensorflow`. Install this package using `pip` - which is a package management system used to install Python packages. Latest versions of Tensorflow won't work, so you will need to make sure that you install version 1.4.0. In the same Anaconda Prompt, type in the following command _(make sure you are connected to the internet)_:
5460

5561
```
56-
pip install tensorflow
62+
pip install tensorflow==1.4.0
5763
```
5864

5965
## Step 3: Install Required Python Packages
@@ -78,6 +84,7 @@ Make sure you are connected to the internet and then type in the Anaconda Prompt
7884

7985
```
8086
pip install .
87+
8188
```
8289

8390
This will complete the installation of all the required Python packages to run ML-Agents.
@@ -90,7 +97,7 @@ As of ML-Agents v0.3, only CUDA 8 and cuDNN 6 is supported.
9097

9198
### Install Nvidia CUDA toolkit
9299

93-
[Download](https://developer.nvidia.com/cuda-toolkit-archive) and install the CUDA toolkit from Nvidia's archive. The toolkit includes GPU-accelerated libraries, debugging and optimization tools, a C/C++ compiler and a runtime library and is needed to run ML-Agents. In this guide, we are using version 8.0.61 ([direct link](https://developer.nvidia.com/compute/cuda/8.0/Prod2/network_installers/cuda_8.0.61_win10_network-exe)).
100+
[Download](https://developer.nvidia.com/cuda-toolkit-archive) and install the CUDA toolkit from Nvidia's archive. The toolkit includes GPU-accelerated libraries, debugging and optimization tools, a C/C++ (Step Visual Studio 2015) compiler and a runtime library and is needed to run ML-Agents. In this guide, we are using version 8.0.61 ([direct link](https://developer.nvidia.com/compute/cuda/8.0/Prod2/network_installers/cuda_8.0.61_win10_network-exe)).
94101

95102
Before installing, please make sure you __close any running instances of Unity or Visual Studio__.
96103

@@ -169,7 +176,7 @@ Make sure to replace the relevant directory location with the one you have insta
169176
Next, install `tensorflow-gpu` using `pip`. In an Anaconda Prompt with the Conda environment ml-agents activated, type in the following command _(make sure you are connected to the internet)_:
170177

171178
```
172-
pip install tensorflow-gpu
179+
pip install tensorflow-gpu==1.4.0
173180
```
174181

175182
Lastly, you should test to see if everything installed properly and that TensorFlow can identify your GPU. In the same Anaconda Prompt, type in the following command:
@@ -186,6 +193,11 @@ You should see something similar to:
186193
Found device 0 with properties ...
187194
```
188195

196+
Step Visual Studio 2015: CUDA 8.0 is not compatible with Visual Studio 2017, so you will need an older version. Uninstall Visual Studio 2017 that comes with Unity, download Visual Studio Enterprise 2015 and install it with the Windows SDK. If you don't want/ can't install Visual Studio Enterprise 2015, you will need:
197+
[Visual C++ Redistributable for Visual Studio 2015](https://www.microsoft.com/en-us/download/details.aspx?id=48145),
198+
[Visual Studio Community 2015](https://www.visualstudio.com/vs/older-downloads/) + [Windows SDK](https://msdn.microsoft.com/en-us/library/mt683786.aspx).
199+
200+
189201
## Acknowledgements
190202

191203
We would like to thank [Jason Weimann](https://unity3d.college/2017/10/25/machine-learning-in-unity3d-setting-up-the-environment-tensorflow-for-agentml-on-windows-10/) and [Nitish S. Mutha](http://blog.nitishmutha.com/tensorflow/2017/01/22/TensorFlow-with-gpu-for-windows.html) for writing the original articles which were used to create this guide.

0 commit comments

Comments
 (0)