๊ธ€ ์ž‘์„ฑ์ž: ๋˜ฅํด๋ฒ .
๋ฐ˜์‘ํ˜•
๋ณธ ํฌ์ŠคํŠธ๋Š” Windows ํ™˜๊ฒฝ์„ ๋ฐ”ํƒ•์œผ๋กœ ์ž‘์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
๊ถ๊ธˆํ•œ ์ ์€ ๋Œ“๊ธ€๋กœ ๋‚จ๊ฒจ์ฃผ์‹œ๋ฉด ์นœ์ ˆํ•˜๊ฒŒ ์•Œ๋ ค๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค ^^!

 

ํŒŒ์ด์ฌ 3 ์„ค์น˜(Install Python3)


https://www.python.org/downloads/

 

Download Python

The official home of the Python Programming Language

www.python.org

ํŒŒ์ด์ฌ 3.6 ๋ฒ„์ „์„ ๋‹ค์šด๋กœ๋“œํ•˜์—ฌ ์„ค์น˜ํ•œ๋‹ค.

ํ˜„์žฌ ํ…์„œํ”Œ๋กœ์šฐ 1 ๋ฒ„์ „๋Œ€๋Š” ๋Š” ํŒŒ์ด์ฌ 3.6๊นŒ์ง€ ์ง€์›ํ•˜๊ณ  2 ๋ฒ„์ „๋Œ€๋Š” 3.7๋ฅผ ์ง€์›ํ•˜์ง€๋งŒ ์•„์ง ๋ฒ ํƒ€ ๋ฒ„์ „์ด๋‹ค.

 

์ž์‹ ์˜ ์‹œ์Šคํ…œ์ด 64๋น„ํŠธ๋ผ๋ฉด ์•„๋ž˜ ๋งํฌ๋ฅผ ํ†ตํ•ด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์„ค์น˜ ํŒŒ์ผ์„ ๋‹ค์šด๋กœ๋“œํ•˜์—ฌ ์„ค์น˜๋ฅผ ์ง„ํ–‰ํ•œ๋‹ค.

https://www.python.org/downloads/windows/

 

Python Releases for Windows

The official home of the Python Programming Language

www.python.org

์„ค์น˜๋Š” ๋ณ„ ๋‹ค๋ฅธ ์„ค๋ช… ์—†์ด Next ๋ˆŒ๋Ÿฌ ์ง„ํ–‰ํ•˜๋ฉด ๋œ๋‹ค. ๋‹จ, ํ…์„œํ”Œ๋กœ์šฐ๋Š” pip๋ผ๋Š” ํŒจํ‚ค์ง€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๊ด€๋ฆฌ ์‹œ์Šคํ…œ์„ ํ†ตํ•ด ์„ค์น˜ํ•  ๊ฒƒ์ด๋ฏ€๋กœ ๊ผญ ์•„๋ž˜์™€ ๊ฐ™์ด ์ฒดํฌํ•ด์ฃผ์ž.

 

ํ…์„œํ”Œ๋กœ์šฐ ์„ค์น˜(Install TensorFlow)


์œˆ๋„์šฐ cmd์ฐฝ์„ ์ผœ์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜์ž.

pip install --upgrade tensorflow

 

์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๊ฐ€ ์ถœ๋ ฅ๋˜๋ฉด์„œ ์„ค์น˜๊ฐ€ ์•ˆ ๋˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋ฐœ์ƒํ•˜๊ธฐ๋„ ํ•˜๋Š”๋ฐ

Collecting tensorflow
  Could not find a version that satisfies the requirement tensorflow (from versi
ons: )
No matching distribution found for tensorflow
You are using pip version 19.0.3, however version 19.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.

 

๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ํ•ด๊ฒฐ์ด ๊ฐ€๋Šฅํ•˜๋‹ค.

python -m pip install --upgrade pip


  Downloading https://files.pythonhosted.org/packages/5c/e0/be401c003291b56efc55
aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl (1.4MB)

    100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 1.4MB 598kB/s
Installing collected packages: pip
  Found existing installation: pip 19.0.3
    Uninstalling pip-19.0.3:
      Successfully uninstalled pip-19.0.3
Successfully installed pip-19.1.1

 

๊ทธ๋ž˜๋„!! ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค๋ฉด?

Collecting tensorflow
  ERROR: Could not find a version that satisfies the requirement tensorflow (fro
m versions: none)
ERROR: No matching distribution found for tensorflow

์ž์‹ ์˜ ์‹œ์Šคํ…œ์ด 64๋น„ํŠธ ์‹œ์Šคํ…œ์ธ๋ฐ 32๋น„ํŠธ ํŒŒ์ด์ฌ์„ ์„ค์น˜ํ•ด์„œ ์—๋Ÿฌ๊ฐ€ ์ƒ๊ธด ๊ฒƒ์ด๋‹ค.

์œ„์˜ ํŒŒ์ด์ฌ ์„ค์น˜ ๊ณผ์ •์„ ํ†ตํ•ด 64๋น„ํŠธ ํŒŒ์ด์ฌ 3์„ ์„ค์น˜ํ•˜์ž.

 

ํ…์„œํ”Œ๋กœ์šฐ ์—๋Ÿฌ ํ•ด๊ฒฐ ๋ฐ ํ…Œ์ŠคํŠธ(TensorFlow Error & Test)


 ํ…์„œํ”Œ๋กœ์šฐ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์„ค์น˜๋˜์—ˆ๋Š”์ง€ ํŒŒ์ด์ฌ IDE๋ฅผ ์‹คํ–‰์‹œ์ผœ์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ช…๋ น์–ด๋ฅผ ๋‚ ๋ ค๋ณด์ž

>>> import tensorflow as tf

 

๋‹ค์Œ๊ณผ ๊ฐ™์€ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๋“ค์ด ์ขŒ๋ฅด๋ฅต ๋‚˜์˜ฌ ์ˆ˜๊ฐ€ ์žˆ๋‹ค ใ…ก_ใ…ก;;; ์—ญ์‹œ ์„ค์น˜๊ฐ€ ์ˆœํƒ„์น˜ ์•Š๋‹ค.

Traceback (most recent call last):
  File "E:\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "E:\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "E:\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "E:\Python37\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "E:\Python37\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed with error code -1073741795

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import tensorflow as tf
  File "E:\Python37\lib\site-packages\tensorflow\__init__.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "E:\Python37\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "E:\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "E:\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "E:\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "E:\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "E:\Python37\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "E:\Python37\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed with error code -1073741795


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

 

ImportError: DLL load failed with error code -1073741795 ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

์—ฌ๋Ÿฌ ์‚ฝ์งˆ๊ณผ ๊ตฌ๊ธ€๋ง์„ ํ•ด๋ณธ ๊ฒฐ๊ณผ, ์•„๋ž˜์˜ ๋ฐฉ๋ฒ•์„ ๋ชจ๋‘ ์‹œ๋„ํ•ด๋ณด๋‹ˆ ํ•ด๊ฒฐ๋˜์—ˆ๋‹ค.

 

1. tensorflow 1.5 ๋ฒ„์ „ ์„ค์น˜

 pip install --upgrade tensorflow ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ์„ค์น˜๋˜๋Š” ๋ฒ„์ „์€ 1.4 ๋ฒ„์ „์ด๋‹ค.

์Šคํƒ์˜ค๋ฒ„ํ”Œ๋กœ์šฐ์— ๋ฒ„์ „์„ ๋†’์—ฌ์„œ ์‹œ๋„ํ•ด๋ณด๋ผ๋Š” ๊ธ€๋“ค์ด ์žˆ์–ด์„œ ์‹œ๋„ํ•ด๋ดค๋”๋‹ˆ ๋‚˜์˜ ๊ฒฝ์šฐ๋Š” ํ•ด๊ฒฐ๋˜์—ˆ๋‹ค.

# ๊ธฐ์กด ์„ค์น˜๋œ ํ…์„œํ”Œ๋กœ์šฐ ์ œ๊ฑฐ
pip uninstall tensorflow

# 1.5 ์„ค์น˜
pip install --upgrade tensorflow==1.5.0

 

2. Visual Studio 2015++ ์žฌ๋ฐฐํฌ ๊ฐ€๋Šฅ ํŒจํ‚ค์ง€ ์—…๋ฐ์ดํŠธ 3 ์„ค์น˜

https://visualstudio.microsoft.com/ko/vs/older-downloads/?rr=https%3A%2F%2Fwww.tensorflow.org%2Finstall%2Fpip

 

์ด์ „ ๋ฒ„์ „์˜ Studio ์†Œํ”„ํŠธ์›จ์–ด ๋‹ค์šด๋กœ๋“œ | Visual Studio - Visual Studio

Visual Studio Community, Professional ๋ฐ Enterprise ์†Œํ”„ํŠธ์›จ์–ด์˜ ์ด์ „ ๋ฒ„์ „์„ ๋‹ค์šด๋กœ๋“œํ•˜์„ธ์š”. ์—ฌ๊ธฐ์„œ Visual Studio(MSDN) ๊ตฌ๋…์— ๋กœ๊ทธ์ธํ•˜์„ธ์š”.

visualstudio.microsoft.com

 

3. CUDA & cuDNN ์„ค์น˜

https://developer.nvidia.com/cuda-10.0-download-archive

 

CUDA Toolkit 10.0 Archive

*/

developer.nvidia.com

๋ณธ์ธ์˜ ํ™˜๊ฒฝ์€ Windows 7์ด๊ธฐ ๋–„๋ฌธ์— Version๋ฅผ 7๋กœ ๋งž์ท„๋‹ค. 10์€ 10์œผ๋กœ ๋ฐ›์œผ๋ฉด ๋œ๋‹ค.

 

https://developer.nvidia.com/cudnn

 

NVIDIA cuDNN

*/

developer.nvidia.com

ํšŒ์›๊ฐ€์ž…์„ํ•ด์•ผ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค.
๋‹ค์Œ๊ณผ ๊ฐ™์ด ์••์ถ•์„ ํ’€๊ณ 
ํ™˜๊ฒฝ๋ณ€์ˆ˜๋ฅผ {์••ํ‘น ํ‘ผ ํด๋”}\bin ์œผ๋กœ ์žก์•„์ฃผ์ž

 

 

Python IDLE์—์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ช…๋ น์–ด๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์ˆ˜ํ–‰๋˜๋ฉด ์„ฑ๊ณต์ด๋‹ค.

>>> import tensorflow as tf
>>> tf.__version__
'1.5.0'

 

๋ฐ˜์‘ํ˜•