Tensorflow: list of tuples as placeholder
I want to use compute_gradients
and generate local gradients. These gradients should be averaged with several local gradients from other machines, after which it will be called apply_gradients
. I use 2 session.runs
to feed_dict
the second, which takes gradients. Since it apply_gradients
expects a list of tuples, I'm looking for an efficient way to do this.
This is how I create a list of tuple placeholders:
grads = cifar10.train_part1(loss, global_step)
xx = [tf.placeholder(tf.float32, shape=grads[0][0].shape) for i in range(10)]
yy = [tf.placeholder(tf.float32, shape=grads[0][0].shape) for i in range(10)]
xyz = zip(xx,yy)
train_op = cifar10.train_part2(loss,global_step, xyz)
I am getting the following error:
NotImplementedError: ('Trying to optimize unsupported type ', tf.Tensor 'Placeholder_10:0' shape=(5, 5, 3, 64) dtype=float32)
+3
source to share
No one has answered this question yet
Check out similar questions: