Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting num_epochs on tf.train.string_input_producer produces an error

Tags:

tensorflow

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?

like image 507
Jeremy Lewi Avatar asked Jan 06 '23 19:01

Jeremy Lewi


1 Answers

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)
like image 158
Jeremy Lewi Avatar answered Jan 17 '23 10:01

Jeremy Lewi