Jeremy Lewi
Jeremy Lewi

Reputation: 6776

Setting num_epochs on tf.train.string_input_producer produces an error

Setting num_epochs on tf.train.string_input_producerto anything other than None produces the error

Attempting to use uninitialized value input_producer/limit_epochs/epoch

What causes this and how can it be fixed?

Upvotes: 4

Views: 1400

Answers (1)

Jeremy Lewi
Jeremy Lewi

Reputation: 6776

This error is caused by not initializing local variables. To ensure local variables are initialized you should do something like the following.

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

Upvotes: 9

Related Questions