[Learning library has been released] of Google's general object recognition NN, Inception-v3 released in 2015 (http://googleresearch.blogspot.jp/2016/03/train-your-own-image-classifier- with.html), so I tried to visualize the network with Tensorboard to deepen my understanding.
$ mkdir /tmp/imagenet
$ cd /tmp/imagenet
$ wget http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz
$ tar xzvf inception-2015-12-05.tgz
$ vi dump.py
import os
import os.path
import tensorflow as tf
from tensorflow.python.platform import gfile
INCEPTION_LOG_DIR = '/tmp/inception_v3_log'
if not os.path.exists(INCEPTION_LOG_DIR):
os.makedirs(INCEPTION_LOG_DIR)
with tf.Session() as sess:
model_filename = '/tmp/imagenet/classify_image_graph_def.pb'
with gfile.FastGFile(model_filename, 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
_ = tf.import_graph_def(graph_def, name='')
writer = tf.train.SummaryWriter(INCEPTION_LOG_DIR, graph_def)
writer.close()
$ mkdir /tmp/inception_v3_log
$ python dump.py
$ tensorboard --logdir /tmp/inception_v3_log/
http: // localhost: 6006 /
Recommended Posts