C2W3_Assignment : unittest.test_create_final_model() fails on binary_crossentropy

Hello,

In C2W3_Assignment, the unittests.test_create_final_model(create_final_model, pre_trained_model, last_output) fails with following message if tf.keras.losses.binary_crossentropy is used:

Failed test case: loss function should be a string or a class from tf.keras.losses. 
Expected: a string or a class from tf.keras.losses.

Can you help clarify why tf.keras.losses.binary_crossentropy could not be used?

you are suppose to use
loss=tf.keras.losses.BinaryCrossentropy()

You are welcome to use binary_crossentropy in real projects. The feedback is purely from the grader standpoint (for learning purposes).

1 Like