1. 程式人生 > >with tf.Session as sess: AttributeError: __exit__

with tf.Session as sess: AttributeError: __exit__

一個小錯誤 ,不過以後會記住的

    with tf.Session as sess:
AttributeError: __exit__
 

錯誤原因  在Session後加Session()

with tf.Session as sess:

修改成下面就好

with tf.Session() as sess: