바뀜
→설치
# cpu stable 버전이 요구하는 넘파이 버전이 일정 미만일 수 있다.
# cpu stable 버전이 요구하는 넘파이 버전이 일정 미만일 수 있다.
|
|
|-
|
|
|
|}
|-
|
|
|}
=== 설치확인 ===
{| class="wikitable"
!과정
!설명
!방법
|-
|-
|설치확인
|설치확인
sess = tf.Session()
sess = tf.Session()
hello = tf.constant('hello')
hello = tf.constant('hello')
sess.run(hello)
print(sess.run(hello))
</syntaxhighlight>
</syntaxhighlight>
|-
|-
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>
|}
|}
</syntaxhighlight>
</syntaxhighlight>
|}
|}
=== 에러 ===
=== 에러 ===
{| class="wikitable"
{| class="wikitable"
|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버전의 문법으로 명령을 실행할 때 나오는 에러.
|위의 설치 참고.
|}
|}
[[분류:딥러닝 라이브러리]]
[[분류:딥러닝 라이브러리]]