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

Asked 2 years ago, Updated 2 years ago, 52 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


© 2024 OneMinuteCode. All rights reserved.