카테고리 없음
[ Tensorflow 오류 ] module 'tensorflow' has no attribute 'Session'
혬혬
2021. 3. 2. 13:05
728x90
import tensorflow as tf
hello=tf.constant("hello, tensorflow")
sess=tf.Session()
print(sess.run(hello))
텐서플로우 버전 2.0.0에서는 session을 정의하고 run해주는 과정을 생략한다.
버전을 확인하고 2.0.0이라면 아래와 같은 코드를 작성해주면 된다.
import tensorflow as tf
node1 =tf.constant(3.0, dtype=tf.float32)
tf.print(node1)
참고 사이트
https://kongnamool.tistory.com/20
728x90