tf.keras.utils.plot_model()

介绍

模型可视化,即:将神经网络模型生成图片

官网api:
https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/keras/utils/plot_model

例子:
https://www.malaoshi.top/show_1EF50kntZTVf.html

语法

tf.keras.utils.plot_model(
    model,
    to_file='model.png',
    show_shapes=False,
    show_layer_names=True,
    rankdir='TB',
    expand_nested=False,
    dpi=96
)
参数
  • model:模型
  • to_file:保存的图片文件名
  • show_shapes:指定是否显示输出数据的形状,默认为False
  • show_layer_names:指定是否显示层名称,默认为True

例子

https://www.malaoshi.top/show_1EF50kntZTVf.html


原文出处:/show_1EF51TySvPhP.html