Python 属性错误:\输入\堆栈溢出

Python 属性错误:\输入\堆栈溢出,python,Python,我正在编写一个python程序并在Google Colaboratory中运行。但它未能通过编译,并给出了AttributeError。有人能帮我吗?非常感谢 total = [] with tf.compat.v1.Session as sess: sess.run(init_op) writer = tf.compat.v1.summary.FileWriter('graphs',sess.graph) AttributeError:输入将括号添加到会话中 始终

我正在编写一个python程序并在Google Colaboratory中运行。但它未能通过编译,并给出了AttributeError。有人能帮我吗?非常感谢

 total = []
 with tf.compat.v1.Session as sess:
      sess.run(init_op)
      writer = tf.compat.v1.summary.FileWriter('graphs',sess.graph)
AttributeError:输入

将括号添加到会话中


始终包括整个程序和整个错误消息。
with tf.compat.v1.Session() as sess: