Where do I get NaN values for the loss function from?

I have a custom loss function that I wrote in Keras, both y_true and y_predict are 100x100 matrices. The label matrix has only a small number of 1's (between 0% to 1%):

def custom_loss(y_true, y_predict):
   K.clip(y_predict, K.epsilon(), 1 - K.epsilon())
   return K.tf.reduce_sum(-1*K.tf.multiply(y_true,K.log(y_predict))) + K.tf.reduce_mean(-1*K.tf.multiply((1-y_true),K.log((1-y_predict))))

The problem that I get Inf and ten only NaN loss values:

compiled <keras.engine.training.Model object at 0x2af594119b00>
Epoch 1/100

  1/250 [..............................] - ETA: 54:30 - loss: inf - acc: 0.3975
  2/250 [..............................] - ETA: 30:17 - loss: nan - acc: 0.1988
  3/250 [..............................] - ETA: 22:11 - loss: nan - acc: 0.1325

Not sure what cause the NaN's