Thanks for your sharing. But I get a problem. I use same inputs as tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=gclasses) ,logits has shape(69856, 4) ,and gclasses has shape(69856,) .
So predictions_pt = tf.where(tf.equal(onehot_labels, 1.0), predictions, 1.-predictions) will put an error.
I want to know if your inputs are the same as" tf.nn.sparse_softmax_cross_entropy_with_logits", and what dose your input shape?
Thanks for your sharing. But I get a problem. I use same inputs as tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=gclasses) ,logits has shape(69856, 4) ,and gclasses has shape(69856,) . So predictions_pt = tf.where(tf.equal(onehot_labels, 1.0), predictions, 1.-predictions) will put an error. I want to know if your inputs are the same as" tf.nn.sparse_softmax_cross_entropy_with_logits", and what dose your input shape?