I need to visualize the structure of a TensorFlow Object Detection model. I am trying to use TensorBoard in Colab with the code below. When TensorBoard loads the logs, it gets stuck on the step "Namespace hierarchy: Finding similar subgraphs".
!pip install -U tensorflow
import tensorflow as tf
from tensorflow.python.client import session
from tensorflow.python.framework import ops
from tensorflow.python.tools import saved_model_utils
from tensorflow.python.framework import importer
from tensorflow.python.summary import summary
!wget http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_resnet50_v1_fpn_640x640_coco17_tpu-8.tar.gz
!tar -xf ssd_resnet50_v1_fpn_640x640_coco17_tpu-8.tar.gz
%load_ext tensorboard
log_dir = '/content/logs'
tag_set = "serve"
model_dir = '/content/ssd_resnet50_v1_fpn_640x640_coco17_tpu-8/saved_model'
with session.Session(graph=ops.Graph()) as sess:
input_graph_def = saved_model_utils.get_meta_graph_def(model_dir,
tag_set).graph_def
importer.import_graph_def(input_graph_def)
pb_visual_writer = summary.FileWriter(log_dir)
pb_visual_writer.add_graph(sess.graph)
print("Model Imported. Visualize by running: "
"tensorboard --logdir={}".format(log_dir))
%tensorboard --logdir=$log_dir
Here is a link to the notebook: https://colab.research.google.com/drive/1MrbNJYR2ds8RRgIBvgUgAILw0Jwdygui?usp=sharing.
Environment: Browser: Chrome OS: Windows RAM: 8 GB
Eventually, I start getting the errors below.
FYI, I tried to run this same process on a Windows computer with 4 GB of RAM, with a TensorBoard server running in a shell. I accessed TensorBoard using the default URL (outside of a notebook). It failed at the same point in the startup process.
I see that Tensorboard got stuck in 'namespace hierarchy finding similar subgraphs' and I'm struggling to implement tensorboard monitoring into the Mask_RCNN training process asked similar questions, but no answer has been provided.
Thanks in advance -- this would really help in the important project I am doing for my company.




