How to inspect a pre-trained TensorFlow model

Installing TensorBoard


pip install tensorboard

In a container

docker run -p 6006:6006 -it bash

Importing an existing model

tensorboard --logdir=/tmp/tensorflow_logdir
  1. Get I have the TensorFlow repository cloned onto my machine (the tools are in tensorflow/python/tools).
  2. Get a model file. I’m using the 12.5MB mnist_model_graph.pb from this article, and I saved it to /tmp.
  3. Pass the model file to It doesn’t matter what location you use for log_dir.
$ python --model_dir /tmp/mnist_model_graph.pb --log_dir /tmp/tensorflow_logdir


Model Imported. Visualize by running: tensorboard --logdir=/tmp/tensorflow_logdir
2017–08–27 18:11:31.334823: W tensorflow/core/platform/] The TensorFlow library wasn’t compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.

Viewing the model in TensorBoard




Machine Learning & Android —

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Tensor with PyTorch🔥

Getting started with Machine learning/AI

Cosine Learning rate decay

Fake News Detection using Deep Learning

Machine learning using Google Colab vs. GCP virtual machine vs. vs. your own hardware

Transposed Convolutions explained with… MS Excel!

Text Classification using LDA

A set of folders, labelled with “Art”, “Fiction”, “Science” and “Medicine” each.

Technical Introduction and Process of Machine Learning

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dan Jarvis

Dan Jarvis

Machine Learning & Android —

More from Medium

Nvidia DeepStream-6.0 : Jetson Setup

Neural Style Transfer in 3 Simple Steps

Neural Networks: the best open-source library for object detection & classification

Vanishing Point Detection