I want to assign a value to a TensorFlow variable in Python and I am using this:
import tensorflow as tf
import numpy as np
x = tf.Variable(0)
init = tf.initialize_all_variables()
sess = tf.InteractiveSession()
sess.run(init)
print(q.eval())
q.assign(1)
print(q.eval()):
And this is the output:
0
0
The value isn't changing, what should I do to correct this?