How can I use tensorboard with tf.estimator.Estimator : <p>I am considering to move my code base to <a href="https://www.tensorflow.org/api_docs/python/tf/estimator/Estimator" rel="noreferrer">tf.estimator.Estimator</a>, but I cannot find an example on how to use it in combination with tensorboard summaries.</p>

<p>MWE:</p>

<pre><code>import numpy as np
import tensorflow as tf

tf.logging.set_verbosity(tf.logging.INFO)

# Declare list of features, we only have one real-valued feature
def model(features, labels, mode):
    # Build a linear model and predict values
    W = tf.get_variable("W", [1], dtype=tf.float64)
    b = tf.get_variable("b", [1], dtype=tf.float64)
    y = W*features['x'] + b
    loss = tf.reduce_sum(tf.square(y - labels))

    # Summaries to display for TRAINING and TESTING
    tf.summary.scalar("loss", loss)    
    tf.summary.image("X", tf.reshape(tf.random_normal([10, 10]), [-1, 10, 10, 1])) # dummy, my inputs are images

    # Training sub-graph
    global_step = tf.train.get_global_step()
    optimizer = tf.train.GradientDescentOptimizer(0.01)
    train = tf.group(optimizer.minimize(loss), tf.assign_add(global_step, 1))

    return tf.estimator.EstimatorSpec(mode=mode, predictions=y,loss= loss,train_op=train)

estimator = tf.estimator.Estimator(model_fn=model, model_dir='/tmp/tf')
# define our data set
x=np.array([1., 2., 3., 4.])
y=np.array([0., -1., -2., -3.])
input_fn = tf.contrib.learn.io.numpy_input_fn({"x": x}, y, 4, num_epochs=1000)

for epoch in range(10):
    # train
    estimator.train(input_fn=input_fn, steps=100)
    # evaluate our model
    estimator.evaluate(input_fn=input_fn, steps=10)
</code></pre>

<p>How can I display my two summaries in tensorboard? Do I have to register a hook in which I use a <code>tf.summary.FileWriter</code> or something else?</p>
