Here is my code:
tf.enable_eager_execution()
writer = tf.summary.FileWriter(result_path+'logs/')
for epoch in range(epochs):
if step_count % 100 == 0:
ref = tf.summary.image("G_ref/{}".format(step_count), image_batch, max_outputs=12)
merge_sum = tf.summary.merge([ref])
sum = sess.run(merge_sum)
writer.add_summary(sum, step_count)
writer.flush()
Error:
Traceback (most recent call last):
File "main.py", line 60, in <module>
writer = tf.compat.v1.summary.FileWriter(result_path+'logs/')
File "/home/jieyang/.conda/envs/tensorflow/lib/python3.7/site-packages/tensorflow_core/python/summary/writer/writer.py", line 360, in __init__
"tf.summary.FileWriter is not compatible with eager execution. "
RuntimeError: tf.summary.FileWriter is not compatible with e