浏览代码

update instructions based on walk through on win

/develop-generalizationTraining-TrainerController
GitHub 7 年前
当前提交
0ffaa217
共有 1 个文件被更改,包括 21 次插入16 次删除
  1. 37
      docs/Installation-Windows.md

37
docs/Installation-Windows.md


# Installing ML-Agents for Windows
We have provided a step by step guide to get ML-Agents working on Windows.
In order to get ML-Agents working with Windows, you will need to have Windows 10 installed. While it is possible for ML-Agents to work on other versions of Windows, we have only tested with a local installation of Windows 10 (not using VM like Bootcamp or Parallels).
Additionally, you will need to check if your GPU is CUDA compatible. Please check Nvidia's page [here](https://developer.nvidia.com/cuda-gpus).

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 7.1.1 for CUDA toolkit version 9.1+ ([direct link](https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.1.1/prod/9.1_20180214/cudnn-9.1-windows10-x64-v7.1)).
After you have downloaded the cuDNN files, you will need to extract the files into the CUDA toolkit directory. In the cuDNN zip file, copy 3 folders called `bin`, `include`, and `lib` into the CUDA toolkit directory. In this guide, the CUDA toolkit directory is located at `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1`
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`. Copy these three folders into the CUDA toolkit directory. In this guide, the CUDA toolkit directory is located at `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1`
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__. From here, click the __Environment Variables__ button. Click __New__ to add a new system variable. 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\v9.1`. Press __OK__ once.
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__. 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_. 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\v9.1`. Press __OK__ once.
To set the two path variables, inside the same __Enviornment 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:

Make sure to replace the relevant directory location with the one you have installed. _Please note that case sensitivity matters_.
## Step 4: 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 use manage separate environments for different distributions of Python. We **strongly** recommend using Python 3 as we do not guarantee supporting Python 2 in future releases. 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).
<a href="https://www.anaconda.com/download/#windows" target="_blank">Download</a> and install Anaconda for Windows. By using Anaconda, you can use manage separate environments for different distributions of Python. We **strongly** recommend using Python 3 as we do not guarantee supporting Python 2 in future releases. 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).
We recommend the default _advanced installation options_. However, select what would work for your specific situation.
After installation, you will need to open __Anaconda Navigator__ to finish. From the Windows search bar, type _anaconda navigator_. You can close Anaconda Navigator after it opens.
## Step 5: Setup a New Conda Environment
You will create a new Conda environment from our installation of Anaconda. This new environment will be specifically for ML-Agents. This means that all packages that you install are localized to just this environment. It will not affect any other installation of Python. Whenever you want to run ML-Agents, you can do some from this new Conda environment.
## Step 5: Setup and Activate a New Conda Environment
You will create a new Conda environment from our installation of Anaconda. This new environment will be specifically for ML-Agents. This means that all 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 can reactivate this Conda environment.
Open a new CMD or Powershell prompt and type in the following command:
Open a new Anaconda Prompt (_Anaconda Prompt_ in the search bar) and type in the following command:
This will create a new Conda environment called ml-agents using Python version 3.6. To use this environment, you will need to activate it. _(In the future, if you need to use this environment again, you can run the same command)_. In the same CMD or Powershell prompt, type in the following command:
You may be asked to install NEW packages. Type `y` and press enter _(make sure you are connected to the internet)_. You will need these new packages. This will create a new Conda environment called ml-agents using Python version 3.6. To use this environment, you will need to activate it. _(In the future, if you need to use this environment again, you can run the same command)_. In the same Anaconda Prompt, type in the following command:
activate ml-agents
conda activate ml-agents
After this, you will need to install `tensorflow-gpu.` This can be installed by using `pip` - which is a package management system used to install Python packages. In the same CMD or Powershell prompt, type in the following command:
You should see `(ml-agents)` prepended on the last line.
pip install tensorflow-gpu
After this, you will need to install `tensorflow-gpu.` This can be installed by 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)_:
Lastly, you should test to see if everything installed properly. You can do this to see if TensorFlow can identify your GPU. In the same CMD or Powershell prompt, type in the following command:
pip install tensorflow tensorflow-gpu
Lastly, you should test to see if everything installed properly. You can do this to see if TensorFlow can identify your GPU. In the same Anaconda Prompt, type in the following command:
python

```
## Step 6: Install Required Python Packages
ML-Agents includes a list of Python dependencies needed to run. Similarly in Step 4, you will be using `pip` to install these Python packages.
ML-Agents includes a list of Python dependencies needed to run. Similarly in Step 5, you will be using `pip` to install these Python packages.
If you haven't already, make sure to clone the repository. You can do this using Git ([download here](https://git-scm.com/download/win)) and running the following commands in a new or same CMD or Powershell window from Step 4:
If you haven't already, make sure to clone the repository. You can do this using Git ([download here](https://git-scm.com/download/win)) and running the following commands in a new or same Anaconda Prompt _(if you are in a new Anaconda Prompt, make sure to activate the ml-agents Conda environment)_:
git clone git@github.com:Unity-Technologies/ml-agents.git

Make sure you are connected to the internet and then type in the following two commands:
conda install –force html5lib
conda install –-force html5lib
pip install .

正在加载...
取消
保存