I'm using the high level tf.contrib.learn.Experiment object to interleave training and evaluation. However, I'm facing an issue with the local variables from the evaluation and metrics modules that are reported as non initialized:
Variables not initialized: mean/total, mean/count, eval_step
I provide a custom local_init_op to tf.train.Scaffold which basically looks like this:
scaffold = tf.train.Scaffold(
local_init_op=tf.group(
iterator.initializer,
tf.tables_initializer(),
tf.local_variables_initializer()))
(where iterator is a tf.contrib.data.Iterator.)
which is then stored in a tf.estimator.EstimatorSpec to be returned by the tf.estimator.Estimator's model_fn function.
As I don't think tf.local_variables_initializer() operates lazily, it means these variables are not yet created.
So how to initialize them?