I am having this code:
import tensorflow as tf
import numpy as np
data = np.random.randint(1000, size=10000)
x = tf.Variable(data, name='x')
y = tf.Variable(5*x*x-3*x+15, name='y')
model = tf.initialize_all_variables();
with tf.Session() as s:
s.run(model)
print (s.run(y))
I am trying to implement an exercise related to tensorflow variables but it fails with the following error:
Attempting to use uninitialized value x_20 [[Node: x_20/read = IdentityT=DT_INT64, _class=["loc:@x_20"], _device="/job:localhost/replica:0/task:0/cpu:0"]]
I also tried to initialize x with a constant but it still fails. What am I missing here ?