Installation under ML-AGENT:WIN10 environment

Source: Internet
Author: User
Tags jupyter jupyter notebook

This is the most comprehensive and detailed ml-agent explanation I have seen. (only for learning and knowledge sharing, if there is infringement, contact deletion.) Thank you! )

a personal blog from Codegize . SOURCE Link: https://www.cnblogs.com/CodeGize/p/7674281.html#undefined

Personal Knowledge Supplement:(when prompted to install the PIP version Low please follow the following steps to resolve, no error can be ignored)

  If your PIP version is not up-to-date, you will get an error when the " enter command installs TensorFlow enter pip install–u tensorflow" step, no way to be the latest version.

Go to pip official website to download the latest version of the extract to the custom directory, from the Start menu, open Anacoda Prompt, into the extracted pip-10.0.1 (I used the version) directory

(The same directory as the disk directory direct CD, non-identical disk, C: or D: (where the disk) into the disk after the CD).

After entering the directory, enter the python setup.py install command for installation. Continue installing tensorflow after installation.

Enter the text:Brief introduction

AI, more accurately, machine learning (learning) has been very hot in the last year. In recent times, Unity has also released a machine learning tool called ml-agent.

The following are introduced in English:

https://blogs.unity3d.com/cn/2017/09/19/introducing-unity-machine-learning-agents/

The following are introduced in Chinese:

Http://forum.china.unity3d.com/thread-27837-1-1.html

The project's address on GitHub is as follows

Https://github.com/Unity-Technologies/ml-agents

From the code structure, Ml-agent realizes the front end with unity, and the backend uses Phython for artificial intelligence calculus.

Set up environment main environment

The official recommended environment is as follows

    • PHYTHON2/3 64-bit
    • Jupyter Notebook
    • TensorFlow (1.0+) (Training)
    • Visual Studio 2017
    • Unity3d 2017
Long Ml-agent code Base

Clone (download) ml-agent, code, and place it from the GitHub website.

Installing Unity2017.2

Download Unity2017.2 from the Unity website and install it.

Https://store.unity.com/cn/download?ref=personal

Installing VS2017

Download from Microsoft Official website https://www.visualstudio.com/zh-hans/downloads/, select the required module after running. Although there are plug-ins that provide Python, we choose to install them separately.

Installing Anaconda

Install Anaconda5.0.0 from Anaconda official website

https://www.anaconda.com/download/#windows

After installation, open Anaconda Navigator from the Start menu and select environments on the left. In the menu below, click Create Creating an environment, named Tensorflow,python version Select 3.6. Wait for environment creation to complete.

Installing TensorFlow and its dependent libraries

From the Start menu, open Anacoda Prompt.

First activate the environment you just created, enter the command

  Activate TensorFlow

Enter command to install TensorFlow

  Pip Install–u TensorFlow

Wait some time until the installation is complete. This completes the installation of the latest version of TensorFlow. (currently 1.3.0 version)

You will also enter the command later, so do not close the window temporarily

Installing Ml-agent dependent libraries

After completing the TensorFlow installation, continue to enter the location of the Python directory in the directory where Ml-agent is located in Anacoda prompt. For example, if the Ml-agent installation directory is D:\Git\ml-agent, enter

CD D:\Git\ml-agent\python

If your anaconda is not installed on the same disk as the Ml-agent directory, you need to switch to the disk where the Ml-agen resides. For example, here Anaconda installation directory is C drive, ml-agent installation directory is D:\ml-agent, you need to switch to D-drive, input

D:

Then start installing the required environment for the demo, enter the command

Pip install.

Note that the last dot is not missing. Wait for the installation to complete. You still don't have to close this window

Run the Build Unity program

Unity's Ml-agent offers a multi-dry demo. Here try to run 3dball this demo.

Use Unity2017 to open the Unity-environment folder under Ml-agent.

Open the scene file under the Assets\ml-agents\examples\3dball directory. Select the Ball3dbrain object under Ball3dacademy in the scene and change the Typeofbrain to external, which means getting the data from the TensorFlow.

menu, select File->build Setting to add the current scene. (You can tick the development build to see the output)

Click playerseting, check Settings

Resolution and Presentation tick run in Background

Resolution and Presentation, Display Resolution dialog set to disable

Go back to the Build setting panel, click Build, and compile to the Ml-agent python directory. Name is 3dball.exe

Run Jupyter Notebook

Go back to the Anacoda Prompt command window. Note Be sure to switch to the directory where Python is located in Ml-agent. Input

Jupyter Notebook

Once run, a command-line window appears on the one hand and a Web page opens at the same time

Click PPO.IPYNB in the Web page. Modify the value of Env_name to the EXE name just compiled. Be careful not to add exe. Then select Cell->runall on the menu

After running, you can see that the EXE just compiled is running.

Summarize

Pay attention to several points

    • Although many articles show that tensorflow with python3.5 is better, but did not study in depth what effect.
    • Due to the 5.0.0 version used by Anaconda, the python3.6 version is used by default. In such a case, if you create a python3.5 environment, install tensorflow1.2, you will see problems with TensorFlow when running. If you use the python3.6 environment, but you install tensorflow1.2, you will see TensorFlow. tensorlayer cannot find the problem. These questions take a lot of time to troubleshoot, so you end up using anaconda5.0.0,python3.6 and tensorflow1.3.
    • When installing a dependent library, be aware that you must switch the environment. Otherwise it is likely to be installed in a different environment. The Activate TensorFlow command (TensorFlow is the name of the environment I created) must be entered before installation here

Installation under ML-AGENT:WIN10 environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.