Freezing the Graph - 2.5 English

Vitis AI Optimizer User Guide (UG1333)

Document ID
Release Date
2.5 English

Now, you have a GraphDef file containing the architecture of the pruned model and a checkpoint file saving trained weights. For prediction or quantization, merge these two files into a single pb file.

Freeze the graph using the following command:

freeze_graph \
    --input_graph=sparse_graph.pbtxt \
    --input_checkpoint=dense.ckpt \
    --input_binary=false \
    --output_graph=frozen.pb \
After completing all the previous steps, you should get the final output file, frozen.pb, of the pruning. Use this file for prediction or quantization. To get the FLOPs of the frozen graph, run the following command:
vai_p_tensorflow --action=flops --input_graph=frozen.pb --input_nodes=input --input_node_shapes=1,224,224,3 --output_nodes=vgg_16/fc8/squeezed