AttributeError: модуль tenensflow_core.summary не имеет атрибута FileWriter - PullRequest
0 голосов
/ 03 мая 2020

У меня ошибка с Tensorflow v2.1.0:

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

Мой код:

import tensorflow as tf

a = tf.constant(5.0)
b = tf.constant(6.0)

c = a*b

sess = tf.compat.v1.Session()

File_Writer = tf.summary.FileWriter(r"C:\Users\Name\Desktop\TensorFlow\graph", sess.graph)

print(sess.run(c))

Ошибка вывода:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-19-898c56a41b1a> in <module>
      6 sess = tf.compat.v1.Session()
      7 
----> 8 File_Writer = tf.summary.FileWriter(r"C:\Users\Name\Desktop\TensorFlow\graph", sess.graph)
      9 
     10 print(sess.run(c))

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

Что мне сделать, чтобы это исправить?

1 Ответ

2 голосов
/ 03 мая 2020

Использование tf.summary.create_file_writer('log_path')

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...