Note : unity ml-agents  

Note (13/Jul/2018) 

windows10
unity 2018.1.0f2
python 3.6.5
conda 4.5.8


1. download zip - https://github.com/Unity-Technologies/ml-agents
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/e1f662d8-6b11-89df-b2b0-4a27f52ec44f.png)

2. extract as `my-ml-agents`  

3. run `unity 2018.1.0f2`

4. open project
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/5617c86a-94ec-49d7-8ec5-1f78f2410ed3.png)

5. select the folder `my-ml-agents\unity-environment`
6. open scene `3DBall`
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/657acfa0-89ea-6e1e-5383-5442419abfdb.png)

7. check it works by `play`
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/8ee5ac70-25a1-a703-7f35-071056a4171f.png)

8. select Ball3DBrain
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/1e675c85-60a6-22e4-fe7c-e5f45059fe50.png)

9. change Brain Type `External`
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/b50c4251-8eaf-61ab-2638-18949b741353.png)

10. check all balls falls by `play` + see the error on Console
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/833009f4-8079-c304-4179-4732dcc6ef0f.png)
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/01dbe785-c344-4e9a-b233-caede3d250bf.png)

11. run `Anaconda prompt`
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/c1a8db45-0350-4879-b7d4-034806fa3d03.png)

12. update conda in case by ``
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/50160997-dc46-1e26-3cbf-2d6caf0a8316.png)

13. `conda create -n my-ml-agents python=3.6.5`
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/8b2300f6-e267-c1fe-015c-40119b59baeb.png)

14. `conda activate my-ml-agents`
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/d02c81ee-920c-5149-8b55-ca2fbca71eb0.png)
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/81d92afa-93b3-84a9-6405-253754401c27.png)

15. change directory to python folder
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/274eb59c-f8fb-e7ca-f56a-0a81145633b9.png)

16. launch `jupyter notebook`
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/d5380447-2c31-6345-6424-fbed7b38db99.png)

17. open `Basics.ipynb` then repeat `run` unless Error occurred 
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/2861a452-95fe-0130-363e-f659de599855.png)
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/0d7a7a95-234c-0600-89e9-1467d94eb4a4.png)

18. [trouble shoot 1] `ModuleNotFoundError: No module named 'google'` 
(cause & solution) forgot ![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/453d9750-783f-fbe7-d1a3-adf231a62ae3.png)

19. [trouble shoot 2] `UnityEnvironmentException: Couldn't launch the 3DBall environment. Provided filename does not match any environments.`
(cause 1) no build yet

20. (solution step1)Build 3DBall (need to create a folder `3DBall` manually)
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/08c5e0fb-f810-1f59-3a33-87d90d243d7e.png)

![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/656e9b30-99cf-8f2d-c20c-902abe445ac2.png)

21.(solutin step2) path should match the folder structure (3DBall/3DBall.exe)
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/7da14ce7-9822-3f3b-4c9a-68c843c46898.png)

22.(solution step3) build folder should be under `python`
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/3fd09e03-f2cf-73bd-a0d3-8762acbc5127.png)

23.see Ball3DAcademy started successfully
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/35106d94-f02d-f0b5-cf8c-b3a49046158f.png)

24. continue `Run` to see the fast random play then game close at the end  of the notebook
![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/e8404429-c367-8f9f-dcef-f7c13ee0befa.png)

![image.png](https://qiita-image-store.s3.amazonaws.com/0/50731/748c1871-9c00-11ad-d87e-bfdd49111416.png)