shamangary/SSR-Net

one train question

alexliyang opened this issue · 3 comments

here , SSR-NET use MAE to be loss function, I try to write code using tensorflow ,
and the error is like that:
ValueError: No gradients provided for any variable, check your graph for ops that do not support gradients,

and the loss code like that:
logits_loss_age = tf.reduce_mean(tf.losses.absolute_difference(tf.cast(self.classifier_logits,tf.int32),age_labels))
optimizer = tf.train.AdamOptimizer(learning_rate,epsilon=1e-4)
train_op = optimizer.minimize(all_loss)

how can I resolve this quesiton?

Hello @alexliyang,

tensorflow/tensorflow#1511 (comment)
Please check on this link. It seems like tf.cast does not provide gradient.

@shamangary
thanks a lot , train is starting :)

@shamangary can I use this net to train age and gender at the same time? and if gender has 3 classes ,ie (0: other, 1: female, 2: male) , in merge_age function V should be set V=1 or V=3?