Rocketknight1:

tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)


Thanks for your response, so I tried you suggestion but still getting the error and to be clear my labels are NOT one hot encoded.

image1586×725 70.6 KB


image1486×1099 126 KB


image1604×714 106 KB

Weird thing is that it worked when, instead of using tf_to_dataset, I used tf_from_tensor_slices. Wanted to use the former as I was following along that part of the course

image1595×332 25.5 KB

appreciate your time and help