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)
source
share