Keras: Cannot convert ‘auto‘ to EagerTensor of dtype float

Take a look at your custom loss function. First define a class and then pass in parameters:

loss=tf.keras.losses.MeanSquaredError(y_true,y_pred) #wrong

m=tf.keras.losses.MeanSquaredError()
loss=m(y_true,y_pred) #right

Read More: