1. 程式人生 > >ValueError: Only call `sigmoid_cross_entropy_with_logits` with named arguments (labels=..., logits=.

ValueError: Only call `sigmoid_cross_entropy_with_logits` with named arguments (labels=..., logits=.

在執行到

loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(output,Y))

時,報錯:
ValueError: Only call sigmoid_cross_entropy_with_logits with named arguments (labels=…, logits=…, …)

應該改為

loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(labels=output,logits=Y))