Setting num_epochs to tf.train.string_input_producer causes an error

Setting num_epochs to tf.train.string_input_producerto nothing but None causes an error

Attempting to use uninitialized value input_producer/limit_epochs/epoch

What causes this and how can it be fixed?

+4
source share
1 answer

This error is caused by not initializing local variables. To initialize local variables, you should do something like the following.

init_op = tf.group(tf.global_variables_initializer(),
                   tf.local_variables_initializer())
sess.run(init_op)
+9
source

All Articles