The code I'm modifying uses tf.get_variablefor weight variables and tf.Variableto initialize the offset. After some searching, it seems that get_variableit should always be approved due to its portability regarding sharing. So I tried changing the offset variable to get_variable, but it can't seem to make it work.
Original: tf.Variable(tf.zeros([128]), trainable=True, name="b1")
My attempt: tf.get_variable(name="b1", shape=[128], initializer=tf.zeros_initializer(shape=[128]))
I get a message that the form should not be specified for constants. But deleting the form then causes an error with no arguments.
I am very new to tf, so I probably misunderstand something fundamental. Thanks for the help in advance.
source
share