inflearn logo
강의

講義

知識共有

皆のためのディープラーニング - 基本的な機械学習とディープラーニングコース

TensorFlowのインストールと基本的な操作(新)

텐서플로우

596

lhr48846306

投稿した質問数 1

0

텐서플로우 설치후, 강의에서 보여준 코드를 입력했는데 다음과 같이 오류가 떠요 ㅠ

In :

import tensorflow as tf

hello = tf.constant("Hello, TensorFlow!")

sess = tf.Session()

print(sess.run(hello))

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-77bcd9f617b4> in <module>
      1 import tensorflow as tf
      2 hello = tf.constant("Hello, TensorFlow!")
----> 3 sess = tf.Session()
      4 print(sess.run(hello))

AttributeError: module 'tensorflow' has no attribute 'Session'

어떻게 해야 할까요 ㅠ

딥러닝 강화학습

回答 2

5

YeSG

텐서플로우가 1.0에서 2.0으로 업그레이드 되며 session이 사라졌다고 합니다.

참고 : https://eclipse360.tistory.com/40

1

jdelay

텐서플로우 버전 2.0.0에서는 Session을 정의하고 run 해주는 과정이 생략되었다고 하네요. 아래와 같이 해주면 될 듯 합니다. 

hello = tf.constant("Hello, TensorFlow!")

tf.print(hello)

tf.placeholder 에러

0

545

1

파이썬 3.10 버전 tensor flow 설치 문의

0

516

0

안녕하세요

0

294

0

딥러닝 vs 머신러닝

0

387

0

출력이미지 사이즈 계산법이 유다시티 강좌와 달라요

0

429

2

train 의미

0

372

0

텐서플로1.0 -> 2.0설치로 인한 1.0 버전 에러

0

464

1

Tensorflow 설치 질문있습니다..

2

330

1

ModuleNotFoundError: No module named 'tensorflow.examples.tutorials' Error 해결법

0

2839

0

강의 잘 들었습니다!

0

306

0

파이썬을 잘 다뤄야 강의를 들을 수 있나요?

0

306

0

plot range

0

280

1

안녕하세요. 수업 너무 재미있게 보고 있던도중 오류가 생겼습니다 ㅠㅠ

0

302

2

validation set을 굳이 만들어야 되나요?

0

430

0

Epoch을 여러번 돌리면..

0

512

1

numpy로 loadtxt 할 때 이런 오류가 뜨는데 도대체 뭔가요 ㅠㅠ?

0

802

0

lab04-1 7분 30초 부분에서 hypothesis와 bias shape에 관한 질문입니다.

0

339

1

tf.train.batch 속도 질문

0

233

0

lab 04-1 multi-variable linear regression 의 cost 값 질문

0

188

1

어렵군요.

0

264

0

Minmaxscaler

0

224

0

cost 값이 변화가 없다는 것은 무엇을 의미하는 건가요?

0

238

0

cost구하는 공식 reduce_sum으로 되어있는거 오타인가요?

0

263

1

H(x)-y 를 제곱을 하는 이유가 궁금합니다.

0

222

0