Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tfl.estimators.get_model_graph

View source on GitHub

Returns all layers and parameters used in a saved model as a graph.

tfl.estimators.get_model_graph(
    saved_model_path, tag='serve'
)

Used in the notebooks

Used in the tutorials

The returned graph is not a TF graph, rather a graph of python object that encodes the model structure and includes trained model parameters. The graph can be used by the tfl.visualization module for plotting and other visualization and analysis.

Example:

model_graph = estimators.get_model_graph(saved_model_path)
visualization.plot_feature_calibrator(model_graph, "feature_name")
visualization.plot_all_calibrators(model_graph)
visualization.draw_model_graph(model_graph)

Args:

  • saved_model_path: Path to the saved model.
  • tag: Saved model tag for loading.

Returns:

A model_info.ModelGraph object that includes the model graph.