keras模型结构可视化


v-star*위위
2025-03-07 05:20:43 (5天前)
  1. 我想看看keras


模型
</跨度>
像这样。我使用了K.get_session()。graph和get

tensorflow.python.framework.ops.Graph位于0x7f2a8b809400

但我要看这个图并保存。我正在使用tensorflow后端

2 条回复
  1. 0# 遇见你 | 2019-08-31 10-32



    安装张量板



    导入它




    1. from keras.callbacks import TensorBoard

    2. </code>


    将其加载到变量中




    1. tbCallBack = TensorBoard(log_dir=’Graph’,
      histogram_freq=10,
      write_graph=True,
      write_images=True)

    2. </code>


    然后将其用作训练中的回调:




    1. model.fit(x, y,
      callbacks=[tbCallBack])

    2. </code>


    确保你有一个名为’Graph’的目录或任何你想要的目录。然后在终端训练之前运行:




    1. tensorboard logdir Graph

    2. </code>


    然后,您可以在浏览器中看到您的图表


登录 后才能参与评论