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
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