설치가 까다로운 편이다. 요구하는 파이썬 버전 조건도 제한적이라 도커 안에서 다루는 편이 편할 것 같다.
+
{| class="wikitable"
+
!OS
+
!방법
+
|-
+
|Window
+
|
+
{| class="wikitable"
+
!과정
+
!설명
+
!방법
+
|-
+
|사전준비
+
|
+
# tensorflow가 요구하는 파이썬 버전 확인하고 다시 설치해준다.(https://www.tensorflow.org/install?hl=ko)
+
# pip install --upgrade pip
+
# <code>pip install tensorflow</code>를 할 때 <code>ERROR: Could not find a version that satisfies the requirement tensorflow</code>가 뜬다면 파이썬이 64bit용이 아니기 때문이다.(텐서플로우는 64bit 기반)
+
# cpu stable 버전을 설치했다면 추가로 넘파이 버전이 1.7 미만이 되도록 다시 설치해야 한다.
+
|
+
|-
+
|설치확인
+
|텐서플로우 버전에 따라 명령어가 다르다. 버전 확인 후 알맞은 방법으로 hello를 표시해보자.
+
{| class="wikitable"
+
!과정
+
!설명
+
|-
+
|1.x버전
+
|<syntaxhighlight lang="python">
+
import tensorflow as tf
+
+
sess = tf.Session()
+
hello = tf.constant('hello')
+
sess.run(hello)
+
</syntaxhighlight>
+
|-
+
|2.x버전
+
|Session을 정의하고 run의 과정이 빠졌다.<syntaxhighlight lang="python">
+
import tensorflow as tf
+
+
node1 = tf.constant(3.0, dtype=tf.float32)
+
node2 = tf.constant(4.0)
+
+
tf.print(node1,node2)
+
</syntaxhighlight>
+
|}
+
|버전확인<syntaxhighlight lang="python">
+
import tensorflow as tf
+
+
print(tf.__version__)
+
</syntaxhighlight>
+
|}
+
|}
+
+
=== 에러 ===
+
{| class="wikitable"
+
!에러
+
!원인
+
!해결방법
+
|-
+
|Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found