바뀜

988 바이트 추가됨 ,  2021년 4월 22일 (목) 23:27
24번째 줄: 24번째 줄:  
# cpu stable 버전이 요구하는 넘파이 버전이 일정 미만일 수 있다.
 
# cpu stable 버전이 요구하는 넘파이 버전이 일정 미만일 수 있다.
 
|
 
|
 +
|-
 +
|
 +
|
 +
|
 +
|}
 +
|-
 +
|
 +
|
 +
|}
 +
 +
=== 설치확인 ===
 +
{| class="wikitable"
 +
!과정
 +
!설명
 +
!방법
 
|-
 
|-
 
|설치확인
 
|설치확인
37번째 줄: 52번째 줄:  
sess = tf.Session()
 
sess = tf.Session()
 
hello = tf.constant('hello')
 
hello = tf.constant('hello')
sess.run(hello)
+
print(sess.run(hello))
 
</syntaxhighlight>
 
</syntaxhighlight>
 
|-
 
|-
48번째 줄: 63번째 줄:     
tf.print(node1,node2)
 
tf.print(node1,node2)
 +
</syntaxhighlight>학습 등의 이유로 굳이 Session의 정의가 필요할 땐 다음과 같은 코드를 상단에 넣는다.
 +
 +
그러면 1.x버전과 같은 용법을 사용할 수 있다.<syntaxhighlight lang="python">
 +
# import tensorflow as tf
 +
import tensorflow.compat.v1 as tf
 +
tf.disable_v2_behavior()
 
</syntaxhighlight>
 
</syntaxhighlight>
 
|}
 
|}
56번째 줄: 77번째 줄:  
</syntaxhighlight>
 
</syntaxhighlight>
 
|}
 
|}
|}
  −
   
=== 에러 ===
 
=== 에러 ===
 
{| class="wikitable"
 
{| class="wikitable"
67번째 줄: 86번째 줄:  
|2.1버전 이후부터 패키지에 CPU, GPU버전이 모두 설치된다.
 
|2.1버전 이후부터 패키지에 CPU, GPU버전이 모두 설치된다.
 
|
 
|
* CPU버전으로 실행(무시하고 진행하면 CPU버전으로 실행한다. 코드 상단에 os를 임포트하고 os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'를 넣어주면 에러메시지도 없앨 수 있다.)
+
* CPU버전으로 실행(무시하고 진행하면 CPU버전으로 실행한다. 텐서플로우를 임포트 하기 전, 코드 상단에 os를 임포트하고 os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'를 넣어주면 에러메시지도 없앨 수 있다. 부작용으로... 에러메시지를 못본다.(기본적인 에러메시지는 뜬다.))
* GPU를 사용할 수 있는 환경 갖추기.
+
* GPU를 사용할 수 있는 환경 갖추기.(2.4.1 기준으로 [https://developer.nvidia.com/cuda-10.1-download-archive-base?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal CUDA 10.1], [https://developer.nvidia.com/rdp/cudnn-archive cuDNN 7.6.4]를 설치해준다.)
 +
|-
 +
|AttributeError: module 'tensorflow' has no attribute 'Session'
 +
|2.X버전은 session정의가 없어진다. 1.x버전의 문법으로 명령을 실행할 때 나오는 에러.
 +
|위의 설치 참고.
 
|}
 
|}
 
[[분류:딥러닝 라이브러리]]
 
[[분류:딥러닝 라이브러리]]
익명 사용자