TensorFlow-GPU Installation Guide in Windows 10 (์๋์ฐ10 ํ ์ํ๋ก์ฐ-GPU ์ค์น๋ฒ)
TensorFlow-GPU Installation Guide in Windows 10
์๋์ฐ10 ํ ์ํ๋ก์ฐ-GPU ์ค์น๋ฒ
The OS information and hardware information of the installation target environment are as follows.
<Installation Environment>
- Operating system information
- Windows 10 Enterprise(similar to Windows 10 Pro), version 1703, OS Build 15063.413, 64bit OS
- Hardware information
- CPU : Intel Core i7-7700HQ 2.80GHz
- GPU : GeForce GTX 1060 6GB GDDR5
<Installation Process: ์ ์ฒด ์ค์น ๊ณผ์ >
- Anaconda installation: ์๋์ฝ๋ค ์ค์น
- CUDA installation : CUDA ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น
- cuDNN installation : cuDNN ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น
- TensorFlow installation : ํ ์ํ๋ก์ฐ ์ค์น
- TensorFlow test : ๊ตฌ๋ ํ ์คํธ
1. Anaconda installation (์๋์ฝ๋ค ์ค์น)
์๋์ฝ๋ค๋ ํ์ด์ฌ์ผ๋ก ๊ตฌ์ฑ๋ ๋ฐ์ดํฐ ๊ณผํ ๊ด๋ จ ์คํ์์ค์ด๋ค. ๋ฐ์ดํฐ ๊ณผํ ์ฐ์ฐ์ ํ์ฉ๋๋ 100์ฌ๊ฐ์ ํ์ด์ฌ, R, ์ค์นผ๋ผ(Scala) ํจํค์ง๋ค์ ํตํฉํ ํ๊ฒฝ์ ์ ๊ณตํ๋ฉฐ, ๊ทธ ์ธ์๋ 720์ฌ๊ฐ์ ์ฐ๊ด ํจํค์ง๋ค์ ์์ฝ๊ฒ ์ฐ๋ํ ์ ์๋ ํ๊ฒฝ์ ์ ๊ณตํ๋ค.
Anaconda is an open source data science module made up of Python. This provides an integrated environment for over 100 Python, R, and Scala packages used for data science operations, and provides an environment for easy-installation about 720 related packages.
[source: https://www.continuum.io]
- download link : https://www.continuum.io/downloads
- latest version : anaconda 4.4.0 with python 3.6
์๋์ฝ๋ค๋ ์ต์ ๋ฒ์ ์ ํ์ด์ฌ(3.5๋ฒ์ ์ด์)์ ๋ด์ฅํ๊ณ ์๊ธฐ ๋๋ฌธ์, ๋ง์ฝ ๊ธฐ์กด์ ํ์ด์ฌ2 ๋๋ ํ์ด์ฌ3๊ฐ ์ค์น๋ ์ปดํจํฐ๋ผ๋ฉด, Path ์ถฉ๋์ ํผํ๊ธฐ ์ํด ๊ธฐ์กด์ ์ค์น๋์๋ ํ์ด์ฌ์ ์ญ์ ํ ํ ์๋์ฝ๋ค๋ฅผ ์ค์นํ ๊ฒ์ ๊ถ์ฅํ๋ค.
Anaconda includes the latest version of Python (version 3.5 or later), so if you already installed Python 2 or Python, I recommends you remove the existing Python and install anaconda to avoid path conflicts.
2. CUDA library installation (CUDA ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น)
CUDA(Compute Unified Device Architecture)๋ GPU์ ๊ฐ์ ๋ช ๋ น ์งํฉ๊ณผ ๋ณ๋ ฌ ์ฐ์ฐ ์์๋ค์ ์ง์ ์ ๊ทผํ๊ธฐ ์ํ GPGPU(General-Purpose computing on GPU) ๊ธฐ์ ์ด๋ค. ์ต์ ํ ์ํ๋ก์ฐ ๋ฒ์ ์ CUDA 8.0 ์ด์ ๋ฒ์ ์ ์ฌ์ฉํ ๊ฒ์ ๊ถ์ฅํ๊ณ ์๋ค.Compute Unified Device Architecture (CUDA) is a general-purpose computing on GPU (GPGPU) technology for direct access to GPU virtual instruction sets and parallel computing resources. The latest tensor flow version recommends using CUDA 8.0 or later. [source : https://developer.nvidia.com/computeworks, https://ko.wikipedia.org/wiki/CUDA]
- download link : https://developer.nvidia.com/cuda-downloads
- latest version (2017-06-20) : CUDA toolkit 8.0.61
3. cuDNN installation (cuDNN ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น)
cuDNN์ Deep Neural Network(์ฌ์ธต์ ๊ฒฝ๋ง)๋ฅผ ์ํด nVidia์ฌ๊ฐ ์ ๊ณตํ๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ด๋ค. ๋ค์ด๋ก๋๋ฅผ ์ํด์๋ nVidia developer์ ํ์๊ฐ์ ์ ํด์ผํ๋ค.CuDNN is a library provided by nVidia for the Deep Neural Network. To download it, downloader should register with nVidia developer.
- download link : https://developer.nvidia.com/cudnn
- available version (2017-04-27) : cuDNN v5.1 for CUDA 8.0/7.5
- latest version (2017-04-27) : cuDNN v6.0 for CUDA 8.0/7.5
ํ์ฌ(2017-06-21) cuDNN v6.0 ๋ฒ์ ์ ํ ์ํ๋ก์ฐ์ ์๋ฒฝํ ํธํ๋์ง ์๋๋ค. v6.0 ๋ฒ์ ์ค์น์, ํ ์ํ๋ก์ฐ์์ module import error๊ฐ ๋ฐ์ํ๋ค. ๋ฐ๋ผ์ ํ ์ํ๋ก์ฐ์ ์ ์์ ์ผ๋ก ํธํ๋๋ cuDNN v5.1 ๋ฒ์ ์ ์ค์นํด์ผ ํ๋ค. cuDNN์ ์์ถํ์ผ ํํ๋ก ๋ค์ด๋ก๋๋๋ฉฐ, CUDA ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์ค์น๋ ํด๋(์: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0)์ ์์ถํด์ ํ์ฌ ๋์จ ํด๋๋ค(lib, include, bin)์ ๋ฎ์ด์ฐ๋ฉด ๋๋ค.
Current (2017-06-21) cuDNN v6.0 version is not fully compatible with TensorFlow. When installing v6.0 version, you might see "module import error" in TensorFlow. Therefore, you need to install cuDNN v5.1 version which is compatible with TensorFlow entirely. cuDNN is downloaded as a compressed file and you just needs to overwrite them(lib, include, bin forders) into CUDA library forder (eg C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0).
4. TensorFlow installation (ํ
์ํ๋ก์ฐ ์ค์น)
์๋์ฐ ์ปค๋งจ๋ ์ฐฝ(cmd)์ ๊ด๋ฆฌ์ ๊ถํ์ผ๋ก ์คํํ ํ ๋ค์ ๋ช
๋ น์ด๋ฅผ ์ด์ฉํ์ฌ ํ
์ํ๋ก์ฐ๋ฅผ ์ค์นํ๋ค.Run the Windows command window (cmd) with administrator privileges and install the tensor flow using the following command.
pip install --upgrade pip
pip install tensorflow-gpu
Run Anaconda Prompt(with administrator) and run the following Python code.
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
์ ์์ ์ผ๋ก ์ค์น๋ ๊ฒฝ์ฐ, ๋ค์๊ณผ ๊ฐ์ ์ถ๋ ฅ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ ์ ์๋ค.
If it is installed normally, you can see the following output.
>> Hello, Tensorflow!
์๋์ฝ๋ค์ ํจ๊ป ์ค์น๋ ์ฃผํผํฐ์์๋ ๋์ผํ ์์ค์ฝ๋๋ก ๊ตฌ๋ํ ์คํธ๋ฅผ ์งํํ ์ ์๋ค.
You can test with Jupiter installed with anaconda.
pip install tensorflow-gpu
5. TensorFlow test (๊ตฌ๋ ํ ์คํธ)
์๋์ฝ๋ค ์ค์น์ ํจ๊ป ์ค์น๋ Anaconda Prompt๋ฅผ ๊ด๋ฆฌ์ ๊ถํ์ผ๋ก ์คํํ ํ, ๋ค์ ํ์ด์ฌ ์ฝ๋๋ฅผ ์คํํ๋ค.Run Anaconda Prompt(with administrator) and run the following Python code.
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
์ ์์ ์ผ๋ก ์ค์น๋ ๊ฒฝ์ฐ, ๋ค์๊ณผ ๊ฐ์ ์ถ๋ ฅ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ ์ ์๋ค.
If it is installed normally, you can see the following output.
>> Hello, Tensorflow!
์๋์ฝ๋ค์ ํจ๊ป ์ค์น๋ ์ฃผํผํฐ์์๋ ๋์ผํ ์์ค์ฝ๋๋ก ๊ตฌ๋ํ ์คํธ๋ฅผ ์งํํ ์ ์๋ค.
You can test with Jupiter installed with anaconda.
TensorFlow-GPU Installation Guide in Windows 10 (์๋์ฐ10 ํ
์ํ๋ก์ฐ-GPU ์ค์น๋ฒ)
Reviewed by Unknown
on
6์ 21, 2017
Rating: 5
Reviewed by Unknown
on
6์ 21, 2017
Rating: 5
