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 \
--output_node_names=”vgg_16/fc8/squeezed”
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