showModel

Help Info

Show a text description of your model and optionally save it to a png file.

usage: showModel [-h] [--model MODEL] [--png PNG]

Named Arguments

--model

The name of the Keras model file to show.

--png

(optional) The name of the png-format image to save.

Usage

A super simple program that displays a summary of your model and optionally saves an image.

Warning

This module is deprecated and will be removed in BPReveal 6.0.0. To see a text description of your model, just do:

model = utils.loadModel(modelFname)
print(model.summary(expand_nested=True, show_trainable=True))

To render your model as an image, you must install graphviz and pydot, then do:

from tensorflow.keras.utils import plot_model
plot_model(model, "output.png", show_shapes=True, show_dtype=True,
           show_layer_names=True, expand_nested=True, show_layer_activations=True)
bpreveal.showModel.main(modelFname, pngFile)

Read in the model named by modelFname, show it as text, and optionally save as a png.

Parameters:
  • modelFname (str) – The name of the Keras model on disk.

  • pngFile (str | None) – The name of the file to write.

Return type:

None

bpreveal.showModel.getParser()

Build the parser.

Returns:

An ArgumentParser, ready to call parse_args()

Return type:

ArgumentParser