I am trying out Tensorflow example on Variables, however I am getting an error while I try to print using tf.Session
ValueError: Variable my_int_variable already exists, disallowed. Did
you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at:
I am pretty sure I have not defined anywhere else and Removed all variables as well on Spyder
import tensorflow as tf
my_int_variable = tf.get_variable("my_int_variable", [1, 2, 3], dtype=tf.int32,
initializer=tf.zeros_initializer)
with tf.Session() as session:
session.run(print(my_int_variable))

print(session.run(my_int_variable)), and should initialize variables in the session before trying to retrieve their values. Otherwise, the snippet that you included will not produce the error that you mention, so it is hard to tell what is happening in your actual code.