I\'m looking for a tensorboard embedding example, with iris data for example like the embedding projector http://projector.tensorflow.org/
But unfortunately i couldn
To take pretrained embeddings and visualize it on tensorboard.
embedding -> trained embedding
metadata.tsv -> metadata information
max_size -> embedding.shape[0]
import tensorflow as tf
from tensorflow.contrib.tensorboard.plugins import projector
sess = tf.InteractiveSession()
with tf.device("/cpu:0"):
tf_embedding = tf.Variable(embedding, trainable = False, name = "embedding")
tf.global_variables_initializer().run()
path = "tensorboard"
saver = tf.train.Saver()
writer = tf.summary.FileWriter(path, sess.graph)
config = projector.ProjectorConfig()
embed = config.embeddings.add()
embed.tensor_name = "embedding"
embed.metadata_path = "metadata.tsv"
projector.visualize_embeddings(writer, config)
saver.save(sess, path+'/model.ckpt' , global_step=max_size )
$ tensorboard --logdir="tensorboard" --port=8080