FailedPreconditionError (see above for traceback): Attempting to use uninitialized value Variable

init_op = tf.global_variables_initializer(),although the initialization is defined here, it does not need to be run to take effect;
sess.run(init_op)

Read More: