This function performs float model
inspection.
VitisInspector.inspect_model(model,
input_shape=None,
dump_model=True,
dump_model_file="inspect_model.h5",
plot=True,
plot_file="model.svg",
dump_results=True,
dump_results_file="inspect_results.txt",
verbose=0)
Arguments
- model
- tf.keras.Model instance, the float model to be inspected. Float model should have concrete input shapes, please build the float model with concrete input shapes or call inspect_model with `input_shape` argument.
- input_shape
- list(int) or list(list(int)), contains the input shape for each input layer. Use default shape info in input layers if not set. Use list of shapes for multiple inputs, e.g. inspect_model(model, input_shape=[224, 224, 3]) or inspect_model(model, input_shape=[[224, 224, 3], [64, 1]]). All dimensions should have concrete values, batch_size dimension should be omitted. Default to None.
- dump_model
- bool, whether to dump the inspected model and save model to disk. The default value is False.
- dump_model_file
- string, path of inspected model file. The default value is 'inspect_model.h5'.
- plot
- bool, whether to plot the model inspect results by
graphviz
and save image to disk. It is helpful when you need to visualize the model inspect results together with some modification hints. Note that only part of output file types can show the hints, such as.svg
. Default to False. - plot_file
- string, file path of model image file when plotting the model. Default to 'model.svg'.
- dump_results
- bool, whether to dump the inspect results and save text to disk. More detailed layer by layer results than screen logging will be dumped to the text file. Default to False.
- dump_results_file
- string, file path of inspect results text file. Default to 'inspect_results.txt'.
- verbose
- int, the logging verbosity level, more detailed logging results will be showed for higher verbose value. Default to 0.