def build(self, input_shape):
self.weight = self.add_weight(shape=(1,self.num_classes),trainable=True,name='prob')
def call(self,x):
x_shape = K.shape(x)[0]
raise ValueError('An operation has `None` for gradient. '
ValueError: An operation has `None` for gradient. Please make sure that all of your ops have a gradient defined (i.e. are differentiable). Common ops without gradient: K.argmax, K.round, K.eval.
--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@tensorflow.org.
To post to this group, send email to dis...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/6e9ceba1-40e1-4f60-a62b-38a090c45db3%40tensorflow.org.
x = tf.Variable([[5,3,2]])
y = tf.cast(x,dtype=tf.float32)
z = tf.multinomial(x,10,output_dtype=tf.int32)
Then both gradients yield None:
tf.gradients(y,x)
[None]
tf.gradients(z,x)
[None]
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/65c6ea62-f92c-46d2-92e8-aa1e20bb89cf%40tensorflow.org.