Tensorflow 2.0 - AttributeError: module 'tensorflow' has no attribute 'Session'

前端 未结 10 1244
小鲜肉
小鲜肉 2020-12-02 05:41

When I am executing the command sess = tf.Session() in Tensorflow 2.0 environment, I am getting an error message as below:

Traceback (most recent         


        
10条回答
  •  隐瞒了意图╮
    2020-12-02 06:22

    TF v2.0 supports Eager mode vis-a-vis Graph mode of v1.0. Hence, tf.session() is not supported on v2.0. Hence, would suggest you to rewrite your code to work in Eager mode.

提交回复
热议问题