Thursday, July 12, 2018

Visualizing frozen models in tensorflow and tensorboard

In tensorflow frozen inference graphs are normal graph with their variables turned to constants and some training layers stripped away. Very often we get these binary files in protobuf (pb) and we want to them out.

A fast way to do that is using tensorboard and a tensorflow tool called import_pb_to_tensorboard.py

To use you need to clone the tensorflow repo locally.

First you convert the model into tensorboard event log


 python ~/tensorflow/tensorflow/python/tools/import_pb_to_tensorboard.py --model_dir PATH_TO_PB_FILE --log_dir PATH_LOG_DIR

afterwards you run tensorboard to visualize it



tensorboard --logdir=visualization:PATH_TO_LOG_DIR





No comments:

Post a Comment