if I run this code, training happens without any errors:
model.compile(optimizer=tf.keras.optimizers.RMSprop(learning_rate=0.001),
loss=‘binary_crossentropy’,
metrics=[‘accuracy’])
however,
if I change the loss=tf.keras.losses.BinaryCrossentropy
training fails with an error
I think @gent.spah has it exactly right, but the solution he provides may be too subtle to notice easily. Here is the relevant section of the Keras Model class documentation:
Loss function. May be a string (name of loss function), or a tf.keras.losses.Lossinstance.