0

Why is this happening? Error message - Attempting to uninitialized Variable Error here is my source: source - Learning .JPG Image in computer using tensorflow

I don't know why this error occur... I already used two types of variable initialization function:

  1. tf.global_variables_initializer()
  2. tf.local_variables_initializer()
Maxim
  • 52,561
  • 27
  • 155
  • 209
bolero
  • 191
  • 3
  • 16

1 Answers1

1

You should use tf.global_variables_initializer() and invoke it after you defined all the variables, not before. The simplest thing would be to do simply:

with tf.Session() as sess:
  sess.run(tf.global_variables_initializer())
  ...
Maxim
  • 52,561
  • 27
  • 155
  • 209