AttributeError: About module'tensorflow_core.summary'has no attribute'FileWriter'

Asked 1 months ago, Updated 1 months ago, 1 views

Running the following code

AttributeError: module'tensorflow_core.summary'has no attribute'FileWriter'

appears.I wonder why

import tensorflow as tf
tf.compat.v1.disable_eager_execution()
a=tf.constant(10,name='10'
b=tf.constant(20,name='20')
c=tf.constant(30,name='30')
add_op=tf.add(a,b,name='mul')
mul_op=tf.multiple(add_op,c,name='mul')
sess=tf.compat.v1.Session()
res=sess.run(mul_op)
print(res)
tf.summary.FileWriter('./logs', sess.graph)`

The Tensorflow version is 2.

python python3 tensorflow

2022-09-30 13:47

1 Answers

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.