Course2_Week3_compute_cost

my code is here. but doesn’t work, showing following error and I’m stuck this for more than 1month.
pls help me.

labels = tf.transpose(labels)
logits = tf.transpose(logits)
cost=tf.reduce_mean(tf.keras.losses.categorical_crossentropy(labels,logits,from_logits=True))

ValueError: Shapes (2, 4) and (2, 6) are incompatible

Hi @daifkn,

This topic may be helpful, they describe a similar problem to yours.

2 Likes