tfl.estimators.get_model_graph

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

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)

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

A model_info.ModelGraph object that includes the model graph.