# Windows »ç¿ëÀÚ¸¦ À§ÇÑ ML-Agents Toolkit ¼³Ä¡ ¹æ¹ý ML-Agents toolkitÀº Windows 10À» Áö¿øÇÕ´Ï´Ù. ´Ù¸¥ ¹öÀüÀÇ Windows À¸·Îµµ ML-Agents toolkitÀº »ç¿ëÇÒ ¼ö ÀÖÁö¸¸ °ËÁõµÇÁö ¾Ê¾Ò½À´Ï´Ù. ¶ÇÇÑ, ML-Agents toolkitÀº Windows VM(Bootcamp ¶Ç´Â º´·Ä ó¸® ȯ°æ °°Àº)ÀÇ »ç¿ë ¶ÇÇÑ °ËÁõµÇÁö ¾Ê¾Ò½À´Ï´Ù . ML-Agents toolkitÀ» »ç¿ëÇϱâ À§ÇØ, ¾Æ·¡¿¡ ¼³¸íµÈ°Í ó·³ Python°ú ¿ä±¸µÇ´Â Python ÆÐÅ°Áö¸¦ ¼³Ä¡ÇØ¾ß ÇÕ´Ï´Ù. ÀÌ °¡À̵å´Â ¶ÇÇÑ GPU ±â¹Ý ÇнÀ(¼÷·ÃÀÚ¸¦ À§ÇÑ)¿¡ ´ëÇÑ ¼³Á¤ ¹æ¹ýÀ» ´Ù·ì´Ï´Ù. ÇöÀç, ML-Agents toolkit¸¦ À§ÇØ GPU ±â¹Ý ÇнÀÀº ÇÊ¿äÇÏÁö ¾ÊÀ¸³ª ÇâÈÄ ¹öÀü ¶Ç´Â ƯÁ¤ »çÇ׿¡ ÇÊ¿äÇÒ ¼ö ÀÖ½À´Ï´Ù. ## ´Ü°è 1: Anaconda¸¦ ÅëÇÑ Python ¼³Ä¡ Windows ¹öÀüÀÇ Anaconda¸¦ [´Ù¿î·Îµå](https://www.anaconda.com/download/#windows)ÇÏ°í ¼³Ä¡ÇϽʽÿÀ. Anaconda¸¦ »ç¿ëÇÔÀ¸·Î½á, ´Ù¸¥ ¹èÆ÷ ¹öÀüÀÇ PythonÀ» ºÐ¸®µÈ ȯ°æ¿¡¼ °ü¸®ÇÒ ¼ö ÀÖ½À´Ï´Ù. Python 2¸¦ ´õÀÌ»ó Áö¿øÇÏÁö ¾Ê±â ¶§¹®¿¡ Python 3.5 ¶Ç´Â 3.6°¡ ÇÊ¿äÇÕ´Ï´Ù. ÀÌ °¡À̵忡¼ ¿ì¸®´Â Python 3.6 ¹öÀü°ú Anaconda 5.1 ¹öÀüÀ» »ç¿ëÇÒ °ÍÀÔ´Ï´Ù. ([64-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86_64.exe) ¶Ç´Â [32-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86.exe) ¸µÅ©).
µðÆúÆ® _advanced installation options_À» ¼±ÅÃÇÏ´Â °ÍÀ» ÃßõÇÏÁö¸¸ »óȲ¿¡ µû¶ó ÀûÀýÇÑ ¿É¼ÇÀ» ¼±ÅÃÇϽʽÿÀ.
¼³Ä¡ ÈÄ¿¡ ¹Ýµå½Ã __Anaconda Navigator__ ¸¦ ¿¾î ¼³Á¤À» ¿Ï·áÇØ¾ß ÇÕ´Ï´Ù. Windows Ž»ö â¿¡¼, _anaconda navigator_ ¸¦ ŸÀÌÇÎÇÏ¿© Anaconda Navigator ¸¦ ¿ ¼ö ÀÖ½À´Ï´Ù. ȯ°æ º¯¼ö°¡ »ý¼ºµÇ¾îÀÖÁö ¾Ê´Ù¸é `conda` ¸í·É¾î¸¦ ŸÀÌÇÎÇßÀ» ¶§ "conda is not recognized as internal or external command" ¶ó´Â ¿¡·¯°¡ ³ª¿Ã °ÍÀÔ´Ï´Ù. À̸¦ ÇØ°áÇϱâ À§ÇØ Á¤È®ÇÑ È¯°æ º¯¼ö ¼³Á¤ÀÌ ÇÊ¿äÇÕ´Ï´Ù. Ž»ö â¿¡¼ `ȯ°æ º¯¼ö`¸¦ ŸÀÌÇÎ ÇÏ¿© (À©µµ¿ì Å°¸¦ ´©¸£°Å³ª ¿ÞÂÊ ¾Æ·¡ À©µµ¿ì ¹öÆ°À» ÅëÇØ ¿ ¼ö ÀÖ½À´Ï´Ù). __½Ã½ºÅÛ È¯°æ º¯¼ö ÆíÁý__ ¿É¼ÇÀ» ºÒ·¯¿É´Ï´Ù.
ÀÌ ¿É¼Ç¿¡¼ __ȯ°æ º¯¼ö__ ¹öÆ°À» Ŭ¸¯ÇÏ°í. ¾Æ·¡ __½Ã½ºÅÛ º¯¼ö__¿¡¼ "Path" º¯¼ö¸¦ ´õºí Ŭ¸¯ÇÏ°í __»õ·Î ¸¸µé±â__¸¦ Ŭ¸¯ÇÏ¿© ´ÙÀ½ »õ path¸¦ Ãß°¡ÇϽʽÿÀ. ```console %UserProfile%\Anaconda3\Scripts %UserProfile%\Anaconda3\Scripts\conda.exe %UserProfile%\Anaconda3 %UserProfile%\Anaconda3\python.exe ``` ## ´Ü°è 2: »õ·Î¿î Conda ȯ°æ ¼³Á¤ ¹× È°¼ºÈ ML-Agents toolkit°ú ÇÔ²² »ç¿ëÇÒ »õ·Î¿î [Conda ȯ°æ](https://conda.io/docs/)À» ¸¸µé °ÍÀÔ´Ï´Ù. ÀÌ ÀÛ¾÷Àº ¼³Ä¡ÇÑ ¸ðµç ÆÐÅ°Áö°¡ ÀÌ È¯°æ¿¡¸¸ ±¹Çѵȴٴ °ÍÀ» ÀǹÌÇÕ´Ï´Ù. ÀÌ´Â ´Ù¸¥ ȯ°æÀ̳ª ´Ù¸¥ ÆÄÀ̽㠼³Ä¡¿¡ ¿µÇâÀ» ³¢Ä¡Áö ¾Ê½À´Ï´Ù. ML-Agents¸¦ ½ÇÇàÇÒ ¶§¿¡´Â Ç×»ó Conda ȯ°æÀ» È°¼ºÈ ½ÃÄÑ¾ß ÇÕ´Ï´Ù. »õ·Î¿î Conda ȯ°æÀ» ¸¸µé±â À§ÇØ, »õ·Î¿î Anaconda ÇÁ·ÒÇÁÆ®(Ž»ö â¿¡¼ _Anaconda Prompt_¸¦ Ŭ¸¯)¸¦ ¿°í ´ÙÀ½ ¸í·É¾î¸¦ ŸÀÌÇÎ ÇϽʽÿÀ: ```sh conda create -n ml-agents python=3.6 ``` »õ ÆÐÅ°Áö¸¦ ¼³Ä¡Çϱâ À§ÇØ ¸Þ¼¼Áö°¡ ³ª¿Ã °æ¿ì `y`¸¦ ŸÀÌÇÎÇÏ°í ¿£Å͸¦ ´©¸£½Ê½Ã¿À _(ÀÎÅͳÝÀÌ ¿¬°áµÇ¾îÀÖ´ÂÁö È®ÀÎÇϽʽÿÀ)_. ÀÌ ¿ä±¸µÇ´Â ÆÐÅ°ÁöµéÀ» ¹Ýµå½Ã ¼³Ä¡ÇØ¾ß ÇÕ´Ï´Ù. »õ·Î¿î Conda ȯ°æ¿¡¼ Python 3.6 ¹öÀüÀÌ »ç¿ëµÇ¸ç ml-agents°¡ È£ÃâµË´Ï´Ù.
¾Õ¼ ¸¸µç ȯ°æÀ» ÀÌ¿ëÇϱâ À§ÇØ ¹Ýµå½Ã È°¼ºÈ¸¦ ÇؾßÇÕ´Ï´Ù. _(ÇâÈÄ¿¡ °°Àº ¸í·É¾î ÅëÇØ È¯°æÀ» Àç»ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù)_. °°Àº Anaconda ÇÁ·ÒÇÁÆ®¿¡¼ ´ÙÀ½ ¸í·É¾î¸¦ ŸÀÌÇÎ ÇϽʽÿÀ: ```sh activate ml-agents ``` È°¼ºÈ ÈÄ¿¡ `(ml-agents)`¶ó´Â ±ÛÀÚ°¡ ¸¶Áö¸· ÁÙ ¾Õ¿¡ ³ªÅ¸³ª´Â °ÍÀ» º¼ ¼ö ÀÖ½À´Ï´Ù. ´ÙÀ½À¸·Î, `tensorflow`¸¦ ¼³Ä¡ÇÕ´Ï´Ù. ÆÄÀ̽ã ÆÐÅ°Áö¸¦ ¼³Ä¡Çϱâ À§ÇØ »ç¿ëÇÏ´Â `pip`¶ó´Â ÆÐÅ°Áö °ü¸® ½Ã½ºÅÛ¸¦ »ç¿ëÇÏ¿© ¼³Ä¡ÇÒ ¼ö ÀÖ½À´Ï´Ù. ÃֽŠ¹öÀüÀÇ TensorFlow´Â ÀÛµ¿ÇÏÁö ¾ÊÀ» ¼ö ÀÖÀ¸¹Ç·Î, ¼³Ä¡ ¹öÀüÀÌ 1.7.1ÀÎÁö È®ÀÎÇØ¾ß ÇÕ´Ï´Ù. °°Àº Anaconda ÇÁ·ÒÇÁÆ® â¿¡¼ ´ÙÀ½ ¸í·É¾î¸¦ ŸÀÌÇÎ ÇϽʽÿÀ._(ÀÎÅͳÝÀÌ ¿¬°áµÇ¾î ÀÖ´ÂÁö È®ÀÎÇÏ¿© ÁֽʽÿÀ)_: ```sh pip install tensorflow==1.7.1 ``` ## ´Ü°è 3: Çʼö ÆÄÀ̽ã ÆÐÅ°Áö ¼³Ä¡ ML-Agents toolkitÀº ¸¹Àº ÆÄÀ̽ã ÆÐÅ°Áö¿¡ Á¾¼ÓÀûÀÔ´Ï´Ù. `pip`¸¦ »ç¿ëÇÏ¿© ÀÌ ÆÄÀ̽ã Á¾¼Ó¼ºµéÀ» ¼³Ä¡ÇϽʽÿÀ. ML-Agents Toolkit ±êÇãºê ÀúÀå¼Ò°¡ ·ÎÄà ÄÄÇ»ÅÍ¿¡ º¹Á¦µÇ¾îÀÖÁö ¾Ê¾Ò´Ù¸é º¹Á¦ÇϽʽÿÀ. GitÀ» ([´Ù¿î·Îµå](https://git-scm.com/download/win))ÇÏ°í ½ÇÇà½ÃŲ ÈÄ ´ÙÀ½ ¸í·É¾î¸¦ Anaconda ÇÁ·ÒÇÁƮâ¿¡ ÀÔ·ÂÇÏ¿© ÁøÇàÇÒ ¼ö ÀÖ½À´Ï´Ù. _(¸¸¾à »õ ÇÁ·ÒÇÁÆ® âÀÌ ¿·ÁÀÖ´Ù¸é `activate ml-agents`¸¦ ŸÀÌÇÎÇÏ¿© ml-agents Conda ȯ°æÀÌ È°¼ºÈ µÇ¾îÀÖ´ÂÁö È®ÀÎÇϽʽÿÀ)_: ```sh git clone https://github.com/Unity-Technologies/ml-agents.git ``` ¸¸¾à GitÀ» »ç¿ëÇÏ°í ½ÍÁö ¾Ê´Ù¸é ¾ðÁ¦µç [¸µÅ©](https://github.com/Unity-Technologies/ml-agents/archive/master.zip)¿¡¼ ¸ðµç ÆÄÀÏÀ» ´Ù¿î·Îµå ÇÒ ¼ö ÀÖ½À´Ï´Ù. `UnitySDK` ÇÏÀ§ µð·ºÅ丮¿¡´Â ÇÁ·ÎÁ§Æ®¿¡ Ãß°¡ÇÒ À¯´ÏƼ ¾Ö¼ÂÀÌ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù. ¶ÇÇÑ ½ÃÀÛÇϴµ¥ µµ¿òÀÌ µÇ´Â ¸¹Àº [¿¹Á¦ ȯ°æ](Learning-Environment-Examples.md)µéÀÌ ÀÖ½À´Ï´Ù. `ml-agents` ÇÏÀ§ µð·ºÅ丮¿¡´Â À¯´ÏƼ ȯ°æ°ú ÇÔ°Ô »ç¿ëÇÏ´Â ½ÉÃþ °ÈÇнÀ Æ®·¹ÀÌ³Ê ÆÄÀ̽ã ÆÐÅ°Áö°¡ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù. `ml-agents-envs` ÇÏÀ§ µð·ºÅ丮¿¡´Â `ml-agents` ÆÐÅ°Áö¿¡ Á¾¼ÓµÇ´Â À¯´ÏƼÀÇ ÀÎÅÍÆäÀ̽º¸¦ À§ÇÑ ÆÄÀ̽ã API°¡ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù. `gym-unity` ÇÏÀ§ µð·ºÅ丮¿¡´Â OpenAI GymÀÇ ÀÎÅÍÆäÀ̽º¸¦ À§ÇÑ ÆÐÅ°Áö°¡ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù. `mlagents-learn`À» ½ÇÇàÇÒ ¶§ Æ®·¹À̳ÊÀÇ È¯°æ ¼³Á¤ ÆÄÀÏÀÌ ÀÌ µð·ºÅ丮 ¾È¿¡ ÇÊ¿äÇϹǷÎ, ÆÄÀÏÀÌ ´Ù¿î·Îµå µÈ µð·ºÅ丮ÀÇ À§Ä¡¸¦ ±â¾ïÇϽʽÿÀ. ÀÎÅͳÝÀÌ ¿¬°áµÇ¾ú´ÂÁö È®ÀÎÇÏ°í Anaconda ÇÁ·ÒÇÁÆ®¿¡¼ ´ÙÀ½ ¸í·É¾î¸¦ ŸÀÌÇÎ ÇϽʽÿÀt: ```console pip install mlagents ``` ML-Agents toolkitÀ» ½ÇÇàÇÒ ¶§ ÇÊ¿äÇÑ ¸ðµç ÆÄÀ̽ã ÆÐÅ°ÁöÀÇ ¼³Ä¡¸¦ ¿Ï·áÇÒ °ÍÀÔ´Ï´Ù. Windows¿¡¼ °¡²û pip¸¦ »ç¿ëÇÏ¿© ƯÁ¤ ÆÄÀ̽ã ÆÐÅ°Áö¸¦ ¼³Ä¡ÇÒ ¶§ ÆÐÅ°ÁöÀÇ Ä³½¬¸¦ Àд °ÍÀÌ ¸·Èú ¶§°¡ ÀÖ½À´Ï´Ù. ´ÙÀ½À» ÅëÇØ ¹®Á¦¸¦ ÇØ°áÇØ º¼ ¼ö ÀÖ½À´Ï´Ù: ```console pip install mlagents --no-cache-dir ``` `--no-cache-dir`´Â pip¿¡¼ ij½¬¸¦ ºñÈ°¼ºÈ ÇÑ´Ù´Â ¶æÀÔ´Ï´Ù. ### °³¹ßÀ» À§ÇÑ ¼³Ä¡ ¸¸¾à `ml-agents` ¶Ç´Â `ml-agents-envs`¸¦ ¼öÁ¤ÇÏ°í ½Í´Ù¸é, PyPi°¡ ¾Æ´Ñ º¹Á¦µÈ ÀúÀå¼Ò·Î ºÎÅÍ ÆÐÅ°Áö¸¦ ¼³Ä¡ÇØ¾ß ÇÕ´Ï´Ù. À̸¦ À§ÇØ, `ml-agents` ¿Í `ml-agents-envs` ¸¦ °¢°¢ ¼³Ä¡ÇØ¾ß ÇÕ´Ï´Ù. ¿¹Á¦¿¡¼ ÆÄÀÏÀº `C:\Downloads`¿¡ À§Ä¡ÇØ ÀÖ½À´Ï´Ù. ÆÄÀÏÀ» º¹Á¦Çϰųª ´Ù¿î·ÎµåÇÑ ÈÄ Anaconda ÇÁ·ÒÇÁÆ®¿¡¼ ml-agents µð·ºÅ丮 ³»ÀÇ ml-agents ÇÏÀ§ µð·ºÅ丮·Î º¯°æÇϽʽÿÀ: ```console cd C:\Downloads\ml-agents ``` ÀúÀå¼ÒÀÇ ¸ÞÀÎ µð·ºÅ丮¿¡¼ ´ÙÀ½À» ½ÇÇàÇϽʽÿÀ: ```console cd ml-agents-envs pip install -e . cd .. cd ml-agents pip install -e . ``` `-e` Ç÷¡±×¸¦ »ç¿ëÇÏ¿© pip¸¦ ½ÇÇà Çϸé ÆÄÀ̽ã ÆÄÀÏÀ» Á÷Á¢ º¯°æÇÒ ¼ö ÀÖ°í `mlagents-learn`¸¦ ½ÇÇàÇÒ ¶§ ¹Ý¿µµË´Ï´Ù. `mlagents` ÆÐÅ°Áö°¡ `mlagents_envs`¿¡ ÀÇÁ¸ÀûÀÌ°í, ´Ù¸¥ ¼ø¼·Î ¼³Ä¡Çϸé PyPi·Î ºÎÅÍ `mlagents_envs` ¸¦ ¼³Ä¡ÇÒ ¼ö Àֱ⠶§¹®¿¡ ÀÌ ¼ø¼´ë·Î ÆÐÅ°Áö¸¦ ¼³Ä¡ÇÏ´Â °ÍÀº Áß¿äÇÕ´Ï´Ù. ## (¿É¼Ç) Step 4: ML-Agents Toolkit¸¦ »ç¿ëÇÑ GPU ÇнÀ ML-Agents toolkit¸¦ À§ÇØ GPU´Â ÇÊ¿äÇÏÁö ¾ÊÀ¸¸ç ÇнÀ Áß¿¡ PPO ¾Ë°í¸®Áò ¼Óµµ¸¦ Å©°Ô ³ôÀÌÁö ¸øÇÕ´Ï´Ù(ÇÏÁö¸¸ ÇâÈÄ¿¡ GPU°¡ ÀÌÁ¡À» ÁÙ ¼ö ÀÖ½À´Ï´Ù). ÀÌ °¡À̵å´Â GPU¸¦ »ç¿ëÇØ ÇнÀÀ» ÇÏ°í ½ÍÀº °í±Þ »ç¿ëÀÚ¸¦ À§ÇÑ °¡À̵å ÀÔ´Ï´Ù. ¶ÇÇÑ GPU°¡ CUDA¿Í ȣȯµÇ´ÂÁö È®ÀÎÇØ¾ß ÇÕ´Ï´Ù. [¿©±â](https://developer.nvidia.com/cuda-gpus) Nvidia ÆäÀÌÁö¿¡¼ È®ÀÎÇØ ÁֽʽÿÀ. ÇöÀç ML-Agents toolkit ´Â CUDA 9.0 ¹öÀü°ú cuDNN 7.0.5 ¹öÀüÀÌ Áö¿øµË´Ï´Ù. ### Nvidia CUDA toolkit ¼³Ä¡ Nvidia ¾ÆÄ«À̺꿡¼ CUDA ÅøŶ(toolkit) 9.0À» [´Ù¿î·Îµå](https://developer.nvidia.com/cuda-toolkit-archive)ÇÏ°í ¼³Ä¡ÇϽʽÿÀ. ML-Agents toolkitÀ» ½ÇÇà½ÃÅ°±â À§ÇÑ CUDA ÅøŶÀº GPU °¡¼Ó ¶óÀ̺귯¸®, µð¹ö±ë-ÃÖÀûÈ µµ±¸, C/C++(ºñÁÖ¾ó ½ºÆ©µð¿À 2017) ÄÄÆÄÀÏ·¯, ·±Å¸ÀÓ ¶óÀ̺귯¸®¸¦ Æ÷ÇÔÇÕ´Ï´Ù. ÀÌ °¡À̵忡¼´Â [9.0.176](https://developer.nvidia.com/compute/cuda/9.0/Prod/network_installers/cuda_9.0.176_win10_network-exe))¹öÀüÀ» »ç¿ëÇÕ´Ï´Ù. ¼³Ä¡Çϱâ Àü, __½ÇÇà ÁßÀÎ À¯´ÏƼ ¶Ç´Â ºñÁÖ¾ó ½ºÆ©µð¿À¸¦ Á¾·áÇß´ÂÁö__ È®ÀÎÇÏ¿© ÁֽʽÿÀ. ÀνºÅç·¯¸¦ ½ÇÇàÇÏ°í Express ¿É¼ÇÀ» ¼±ÅÃÇϽʽÿÀ. CUDA ÅøŶÀ» ¼³Ä¡ÇÒ µð·ºÅ丮¿¡ À¯ÀÇÇØ ÁֽʽÿÀ. ÀÌ °¡À̵忡¼´Â, `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0` °æ·Î¿¡ ¼³Ä¡ÇÕ´Ï´Ù. ### Nvidia cuDNN ¶óÀ̺귯¸® ¼³Ä¡ Nvidia¿¡¼ cuDNN ¶óÀ̺귯¸®¸¦ [´Ù¿î·Îµå](https://developer.nvidia.com/cudnn)ÇÏ°í ¼³Ä¡ÇϽʽÿÀ. cuDNNÀº ½ÉÃþ ½Å°æ¸ÁÀ» À§ÇÑ ±âº»ÀÌ µÇ´Â GPU °¡¼Ó ¶óÀ̺귯¸®. ´Ù¿î·Îµå Àü¿¡ Nvidia Developer Program¿¡ °¡ÀÔÇؾßÇÒ °ÍÀÔ´Ï´Ù(¹«·á).
°¡ÀÔÇÏ°í cuDNN [´Ù¿î·Îµå ÆäÀÌÁö](https://developer.nvidia.com/cudnn)·Î µ¹¾Æ°¡½Ê½Ã¿À. ªÀº ¼³¹®Á¶»ç¿¡ ÀÀ´äÇØ¾ß ÇÒ ¼öµµ ÀÖ½À´Ï´Ù. When you get to the list cuDNN ¸±¸®Áî ¸®½ºÆ®¿¡¼ __´Ü°è 1¿¡¼ ¼³Ä¡ÇÑ CUDA ÅøŶ¿¡ ¸Â´Â ¹öÀüÀ» ´Ù¿î·ÎµåÇÏ°í ÀÖ´ÂÁö È®ÀÎÇϽʽÿÀ.__ ÀÌ °¡À̵忡¼´Â, CUDA ÅøŶ 9.0 ¹öÀüÀ» À§ÇØ 7.0.5 ¹öÀüÀ» »ç¿ëÇÕ´Ï´Ù ([´Ù¿î·Îµå ¸µÅ©](https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.0.5/prod/9.0_20171129/cudnn-9.0-windows10-x64-v7)). cuDNN ÆÄÀÏÀ» ´Ù¿î·Îµå ÇÑ ÈÄ¿¡, CUDA ÅøŶ µð·ºÅ丮¾È¿¡ ÆÄÀÏÀ» ÃßÃâ(¾ÐÃà ÇØÁ¦)ÇØ¾ß ÇÕ´Ï´Ù. cuDNN zip ÆÄÀÏ ¾È¿¡´Â ¼¼°¡Áö Æú´õ `bin`, `include`, ±×¸®°í `lib`°¡ ÀÖ½À´Ï´Ù.
ÀÌ ¼¼°¡Áö Æú´õ¸¦ CUDA ÅøŶ µð·ºÅ丮¾È¿¡ º¹»çÇϽʽÿÀ. CUDA ÅøŶ µð·ºÅ丮´Â `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0`¿¡ À§Ä¡ÇØ ÀÖ½À´Ï´Ù.
### ȯ°æ º¯¼ö ¼³Á¤ 1°³ÀÇ È¯°æ º¯¼ö¿Í 2°³ÀÇ °æ·Î º¯¼ö¸¦ Ãß°¡ÇØ¾ß ÇÕ´Ï´Ù. ȯ°æ º¯¼ö¸¦ ¼³Á¤Çϱâ À§ÇØ, Ž»ö â¿¡¼ `ȯ°æ º¯¼ö`¸¦ ŸÀÌÇÎ ÇÏ¿© (À©µµ¿ì Å°¸¦ ´©¸£°Å³ª ¿ÞÂÊ ¾Æ·¡ À©µµ¿ì ¹öÆ°À» ÅëÇØ ¿ ¼ö ÀÖ½À´Ï´Ù). __½Ã½ºÅÛ È¯°æ º¯¼ö ÆíÁý__ ¿É¼ÇÀ» ºÒ·¯¿É´Ï´Ù.
ÀÌ ¿É¼Ç¿¡¼ __ȯ°æ º¯¼ö__ ¹öÆ°À» Ŭ¸¯ÇÏ°í ½Ã½ºÅÛ º¯¼öÀÇ __»õ·Î ¸¸µé±â__¸¦ Ŭ¸¯ÇϽʽÿÀ _(»ç¿ëÀÚ º¯¼ö°¡ ¾Æ´Ñ ¾Æ·¡ÀÇ __½Ã½ºÅÛ º¯¼ö__ÀÎÁö È®ÀÎÇϽʽÿÀ).
__º¯¼ö À̸§__À» `CUDA_HOME`À¸·Î ¼³Á¤ÇÏ°í º¯¼ö °ª¿¡´Â CUDA ÅøŶ µð·ºÅ丮 °æ·Î¸¦ ÀÔ·ÂÇØ ÁֽʽÿÀ. ÀÌ °¡À̵忡¼ µð·ºÅ丮 °æ·Î´Â `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0` ÀÔ´Ï´Ù. È®ÀÎ ¹öÆ°À» ´·¯ÁֽʽÿÀ.
2°³ÀÇ °æ·Î º¯¼ö ¼³Á¤À» À§ÇØ __ȯ°æ º¯¼ö__ ⠱׸®°í ¾Æ·¡ µÎ¹ø° ¹Ú½ºÀÇ __½Ã½ºÅÛ º¯¼ö__¾È¿¡¼, `Path` º¯¼ö¸¦ ã¾Æ Ŭ¸¯ÇÏ°í __ÆíÁý__¹öÆ°À» ´©¸£½Ê½Ã¿À. ¸®½ºÆ®¿¡ 2°³ÀÇ µð·ºÅ丮¸¦ Ãß°¡ÇÒ °ÍÀÔ´Ï´Ù. µÎ µð·ºÅ丮´Â ´ÙÀ½°ú °°½À´Ï´Ù: ```console C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\extras\CUPTI\libx64 ``` ¿¬°ü µð·ºÅ丮 À§Ä¡°¡ ¼³Ä¡µÈ µð·ºÅ丮 °æ·ÎÀÎÁö È®ÀÎÇϽʽÿÀ. _´ë¼Ò¹®ÀÚ¿¡ À¯ÀÇÇϽʽÿÀ_.
### TensorFlow GPU ¼³Ä¡ ´ÙÀ½, `pip`¸¦ »ç¿ëÇÏ¿© 1.7.1. ¹öÀü `tensorflow-gpu`¸¦ ¼³Ä¡ÇϽʽÿÀ . ml-agents Conda ȯ°æÀ» È°¼ºÈ ½ÃŲ Anaconda ÇÁ·ÒÇÁÆ®¿¡¼ CPU¿ë TensorFlow »èÁ¦ÇÏ°í GPU¿ë TensorFlow¸¦ ¼³Ä¡Çϱâ À§ÇØ ´ÙÀ½ ¸í·É¾î¸¦ ŸÀÌÇÎ ÇϽʽÿÀ _(ÀÎÅͳÝÀÌ ¿¬°áµÇ¾î ÀÖ´ÂÁö È®ÀÎÇϽʽÿÀ)_: ```sh pip uninstall tensorflow pip install tensorflow-gpu==1.7.1 ``` ¸¶Áö¸·À¸·Î, ¸ðµç °ÍÀÌ Á¦´ë·Î ¼³Ä¡µÇ¾î ÀÖ°í, Tensorflow¿¡¼ GPU¸¦ ÀνÄÇÏ°í ÀÖ´ÂÁö Å×½ºÆ®ÇؾßÇÕ´Ï´Ù. °°Àº Anaconda ÇÁ·ÒÇÁÆ®¿¡¼ PythonÀ» È£ÃâÇÏ¿© ¿±´Ï´Ù: ```sh python ``` ±×¸®°í ´ÙÀ½ ¸í·É¾î¸¦ ŸÀÌÇÎ ÇϽʽÿÀ: ```python import tensorflow as tf sess = tf.Session(config=tf.ConfigProto(log_device_placement=True)) ``` ´ÙÀ½°ú ºñ½ÁÇÑ ¹®ÀåÀ» º¼ ¼ö ÀÖÀ» °ÍÀÔ´Ï´Ù: ```console Found device 0 with properties ... ``` ## Acknowledgments ÀÌ °¡À̵带 ¸¸µé±â À§ÇØ »ç¿ëµÈ ÃʾÈÀ» ÀÛ¼ºÇÑ [Jason Weimann](https://unity3d.college/2017/10/25/machine-learning-in-unity3d-setting-up-the-environment-tensorflow-for-agentml-on-windows-10/) °ú [Nitish S. Mutha](http://blog.nitishmutha.com/tensorflow/2017/01/22/TensorFlow-with-gpu-for-windows.html) ¿¡°Ô °¨»çµå¸³´Ï´Ù. ## ÇÑ±Û ¹ø¿ª ÇØ´ç ¹®¼ÀÇ ÇÑ±Û ¹ø¿ªÀº [ÀåÇöÁØ (Hyeonjun Jang)]([https://github.com/janghyeonjun](https://github.com/janghyeonjun))¿¡ ÀÇÇØ ÁøÇàµÇ¾ú½À´Ï´Ù. ³»¿ë»ó ¿À·ù³ª ¿ÀÅ»ÀÚ°¡ ÀÖ´Â °æ¿ì totok682@naver.com À¸·Î ¿¬¶ôÁÖ½Ã¸é °¨»çµå¸®°Ú½À´Ï´Ù.