【问题标题】:Unable to visualize graph in tensorboard无法在张量板中可视化图形
【发布时间】:2016-10-18 05:59:12
【问题描述】:

在编写摘要时,

summary_writer1 = tf.train.SummaryWriter(logs_path, graph=tf.get_default_graph())

工作正常并在 tensorboard 上生成图形,但在做

summary_writer2 = tf.train.SummaryWriter(logs_path, sess.graph())

在运行代码训练模型时产生以下错误,

Traceback (most recent call last):
  File "MultiLayerPerceptron.py", line 121, in <module>
    summary_writer2 = tf.train.SummaryWriter(logs_path, graph=sess.graph())
TypeError: 'Graph' object is not callable

还有summary_writer1 中的默认图表和summar_writer2 中的图表有什么区别

【问题讨论】:

    标签: python machine-learning tensorflow tensorboard


    【解决方案1】:

    默认图和sess.graph 没有区别,它们是完全相同的图。

    错误很明显:

    'Graph' 对象不可调用

    会话对象有一个graph 成员,而不是一个图方法。 只需从graph=sess.graph() 中删除(),一切都会如您所愿。

    【讨论】:

      猜你喜欢
      • 2017-07-12
      • 2017-08-19
      • 2021-04-03
      • 2017-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-08
      • 2012-06-17
      相关资源
      最近更新 更多