Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
cd45be1
removed old instructions for windows
shihzy Mar 10, 2018
ba50ee2
Create Installation-Windows.md
shihzy Mar 12, 2018
b6b27cc
added header and windows 10 instructions
shihzy Mar 12, 2018
64a8c4a
Update to Instructions
shihzy Mar 12, 2018
89a97fb
screenshot for cuDNN membership required
shihzy Mar 12, 2018
1d4a8f7
Update to instructions
shihzy Mar 12, 2018
9b65a76
Updated with anaconda and GPU CUDA compatible
shihzy Mar 13, 2018
395f407
Update with python package installs
shihzy Mar 13, 2018
5112f6f
typo
shihzy Mar 13, 2018
8f97639
Added in new conda environment steps and clean up
shihzy Mar 13, 2018
6d62dab
typo
shihzy Mar 13, 2018
5205c05
Included environment and path variables and typos
shihzy Mar 13, 2018
b1ebafe
Added acknowledgements and typos
shihzy Mar 13, 2018
b19f877
update instructions based on walk through on win
shihzy Mar 13, 2018
b6c61af
Minor updates
shihzy Mar 13, 2018
46d8868
minor updates
shihzy Mar 13, 2018
f37a701
step 1 - install nvidia cuda image
shihzy Mar 13, 2018
95769f1
cudnn zip and cuda directory
shihzy Mar 13, 2018
108b6c1
environment variables updload
shihzy Mar 13, 2018
c9e1a2f
conda images
shihzy Mar 13, 2018
572ffda
Delete conda_new.PNG
shihzy Mar 13, 2018
1123b6b
updated conda image
shihzy Mar 13, 2018
0406e82
added screenshots
shihzy Mar 13, 2018
e9b71b7
Cleaned up wording, final touches
shihzy Mar 13, 2018
fd919be
Updated to new doc from main installation
shihzy Mar 13, 2018
58f4b2c
Using "a" VM
shihzy Mar 13, 2018
f1ae832
space between headers
shihzy Mar 13, 2018
7a47024
Separated GPU based training as optional and adv.
shihzy Mar 13, 2018
944388f
fixes duplicate "in this guide"
shihzy Mar 13, 2018
088325c
Extra space
shihzy Mar 13, 2018
5e9c1a5
cleaned up code markdowns
shihzy Mar 13, 2018
4e6be5f
cleaned up code markdowns
shihzy Mar 13, 2018
d8b0169
you can use manage ---> you can manage
shihzy Mar 13, 2018
e024879
Moved test to see if tensorflow gpu is working
shihzy Mar 13, 2018
6cd86a2
change to ML-agents Windows 10 support
shihzy Mar 13, 2018
378bed7
Update to installing python and packages
shihzy Mar 13, 2018
ff692df
update on anaconda navigator
shihzy Mar 13, 2018
cf85d43
added link to conda environment
shihzy Mar 13, 2018
2144abc
update to installing additional packages
shihzy Mar 13, 2018
08c8214
update to activate
shihzy Mar 13, 2018
6dd27c1
update to instructions for tensorflow and gpu
shihzy Mar 13, 2018
f1559e9
update to testing tensorflow gpu
shihzy Mar 13, 2018
517c375
update to cloning git repo
shihzy Mar 13, 2018
c128100
typo
shihzy Mar 13, 2018
fdc0331
changed windows version
shihzy Mar 13, 2018
9ecdb3b
python 3 required
shihzy Mar 13, 2018
71debf7
seperated tensorflow and tensorflow-gpu
shihzy Mar 14, 2018
6fb7191
Updated CUDA and cuDNN to working versions
shihzy Mar 14, 2018
5bfab0f
removed CUDA screenshot
shihzy Mar 14, 2018
bb04df8
Delete install_nvidia_cuda_toolkit.PNG
shihzy Mar 14, 2018
9d76a45
updated screenshots
shihzy Mar 14, 2018
525cab4
Delete cuda_toolkit_directory.PNG
shihzy Mar 14, 2018
3ca6427
Delete cudnn_zip_files.PNG
shihzy Mar 14, 2018
b9f30f5
Delete new_system_variable.PNG
shihzy Mar 14, 2018
f7a5828
Delete path_variables.PNG
shihzy Mar 14, 2018
9a83437
Delete system_variable_name_value.PNG
shihzy Mar 14, 2018
5b094fb
updated CUDA and cuDNN screenshots
shihzy Mar 14, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 193 additions & 0 deletions docs/Installation-Windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
# Installing ML-Agents for Windows

ML-Agents supports Windows 10. While it might be possible to run ML-Agents using other versions of Windows, it has not been tested on other versions. Furthermore, ML-Agents has not been tested on a Windows VM such as Bootcamp or Parallels.

To use ML-Agents, you install Python and the required Python packages as outlined below. This guide also covers how set up GPU-based training (for advanced users). GPU-based training is not required for the v0.3 release of ML-Agents. However, training on a GPU might be required by future versions and features.

## Step 1: Install Python via Anaconda

<a href="https://www.anaconda.com/download/#windows" target="_blank">Download</a> 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).

<p align="center">
<img src="images/anaconda_install.PNG"
alt="Anaconda Install"
width="500" border="10" />
</p>

We recommend the default _advanced installation options_. However, select the options appropriate for your specific situation.

<p align="center">
<img src="images/anaconda_default.PNG"
alt="Anaconda Install"
width="500" border="10" />
</p>

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.

## Step 2: Setup and Activate a New Conda Environment

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.

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

```
conda create -n ml-agents python=3.6
```

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.

<p align="center">
<img src="images/conda_new.PNG"
alt="Anaconda Install"
width="500" border="10" />
</p>

To use this environment, you must activate it. _(To use this environment In the future, you can run the same command)_. In the same Anaconda Prompt, type in the following command:

```
conda activate ml-agents
```

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

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)_:

```
pip install tensorflow
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is also related with GPU, so maybe set it to optional also?

## Step 3: Install Required Python Packages

ML-Agents depends on a number of Python packages. Use `pip` to install these Python dependencies.

If you haven't already, clone the ML-Agents Github repository to your local computer. You can do this using Git ([download here](https://git-scm.com/download/win)) and running the following commands in an Anaconda Prompt _(if you open a new prompt, be sure to activate the ml-agents Conda environment by typing `activate ml-agents`)_:

```
git clone git@github.com:Unity-Technologies/ml-agents.git
```

If you don't want to use Git, you can always directly download all the files [here](https://github.com/Unity-Technologies/ml-agents/archive/master.zip).

In our example, the files are located in `C:\Downloads`. After you have either cloned or downloaded the files, from the Anaconda Prompt, change to the python directory inside the ML-agents directory:

```
cd C:\Downloads\ml-agents\python
```

Make sure you are connected to the internet and then type in the Anaconda Prompt:

```
pip install .
```

This will complete the installation of all the required Python packages to run ML-Agents.

## (Optional) GPU Training using ML-Agents

Not required to use v0.3 for ML-Agents. This is a guide for advanced users who want to train using GPUs. Additionally, you will need to check if your GPU is CUDA compatible. Please check Nvidia's page [here](https://developer.nvidia.com/cuda-gpus).

As of ML-Agents v0.3, only CUDA 8 and cuDNN 6 is supported.

## (Optional) Step 1: Install Nvidia CUDA toolkit

<a href="https://developer.nvidia.com/cuda-toolkit-archive" target="_blank">Download</a> 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)).

_Before installing, please make sure you __close any running instances of Unity or Visual Studio.___

Run the installer and select the Express option. Note the directory where you installed the CUDA toolkit. In this guide, we installed in the directory `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0`

## (Optional) Step 2: Install Nvidia cuDNN library

<a href="https://developer.nvidia.com/cudnn" target="_blank">Download</a> and install the cuDNN library from Nvidia. cuDNN is is a GPU-accelerated library of primitives for deep neural networks. Before you can download, you will need to sign up for free to the Nvidia Developer Program.

<p align="center">
<img src="images/cuDNN_membership_required.png"
alt="cuDNN membership required"
width="500" border="10" />
</p>

Once you've signed up, go back to the cuDNN <a href="https://developer.nvidia.com/cudnn" target="_blank">downloads page</a>. You may or may not be asked to fill out a short survey. When you get to the list cuDNN releases, __make sure you are downloading the right version for the CUDA toolkit you installed in Step 1.__ In this guide, we are using version 6.0 for CUDA toolkit version 8.0 ([direct link](https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v6/prod/8.0_20170307/cudnn-8.0-windows10-x64-v6.0-zip)).

After you have downloaded the cuDNN files, you will need to extract the files into the CUDA toolkit directory. In the cuDNN zip file, there are three folders called `bin`, `include`, and `lib`.

<p align="center">
<img src="images/cudnn_zip_files.PNG"
alt="cuDNN zip files"
width="500" border="10" />
</p>

Copy these three folders into the CUDA toolkit directory. The CUDA toolkit directory is located at `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0`

<p align="center">
<img src="images/cuda_toolkit_directory.PNG"
alt="cuda toolkit directory"
width="500" border="10" />
</p>

## (Optional) Step 3: Set Environment Variables

You will need to add one environment variable and two path variables.

To set the environment variable, type `environment variables` in the search bar (this can be reached by hitting the Windows key or the bottom left Windows button). You should see an option called __Edit the system environment variables__.

<p align="center">
<img src="images/edit_env_var.png"
alt="edit env variables"
width="250" border="10" />
</p>

From here, click the __Environment Variables__ button. Click __New__ to add a new system variable _(make sure you do this under __System variables__ and not User variables_.

<p align="center">
<img src="images/new_system_variable.PNG"
alt="new system variable"
width="500" border="10" />
</p>

For __Variable Name__, enter `CUDA_HOME`. For the variable value, put the directory location for the CUDA toolkit. In this guide, the directory location is `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0`. Press __OK__ once.

<p align="center">
<img src="images/system_variable_name_value.PNG"
alt="system variable names and values"
width="500" border="10" />
</p>

To set the two path variables, inside the same __Environment Variables__ window and under the second box called __System Variables__, find a variable called `PATH` and click __Edit__. You will add two directories to the list. For this guide, the two entries would look like:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\extras\CUPTI\libx64

Make sure to replace the relevant directory location with the one you have installed. _Please note that case sensitivity matters_.

<p align="center">
<img src="images/path_variables.PNG"
alt="Path variables"
width="500" border="10" />
</p>

## (Optional) Step 4: Install TensorFlow GPU
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)_:

```
pip install tensorflow-gpu
```

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:

```
python

import tensorflow as tf

sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
```

You should see something similar to:

```
Found device 0 with properties ...
```

## Acknowledgements

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.
4 changes: 1 addition & 3 deletions docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ to refer to either Python 2 or 3, depending on your installation.

### Windows Users

If you are a Windows user who is new to Python and TensorFlow, follow
[this guide](https://unity3d.college/2017/10/25/machine-learning-in-unity3d-setting-up-the-environment-tensorflow-for-agentml-on-windows-10/)
to set up your Python environment.
If you are a Windows user who is new to Python and TensorFlow, follow [this guide](Installation-Windows.md) to set up your Python environment.

### Mac and Unix Users

Expand Down
Binary file added docs/images/anaconda_default.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/anaconda_install.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/conda_new.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/cuDNN_membership_required.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/cuda_toolkit_directory.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/cudnn_zip_files.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/edit_env_var.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/new_system_variable.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/path_variables.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/system_variable_name_value.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.