I am using Tensorflow placeholder in order to do a calculation however Tensorflow tells me that I have an initialization error.
import tensorflow as tf
import numpy as np
al = np.array([2.5, 0.0, 2, 8],dtype=float)
bl = np.array([3, -0.5, 2, 7],dtype=float)
sess = tf.Session()
a = tf.placeholder(dtype='float32')
b = tf.placeholder(dtype='float32')
c = tf.metrics.mean_squared_error(a,b)
d = sess.run(c, {a: al, b:bl } )
I cannot see where my mistake is. The error message is:
FailedPreconditionError (see above for traceback): Attempting to use uninitialized value mean_squared_error/count
[[Node: mean_squared_error/count/read = Identity[T=DT_FLOAT, _class=["loc:@mean_squared_error/AssignAdd_1"], _device="/job:localhost/replica:0/task:0/device:CPU:0"](mean_squared_error/count)]]