Keras custom loss gives AttributeError: 'int' object has no attribute 'get_shape'
I'm using keras and trying to create a custom loss. When I want to use maximum function I'm getting the following error.
def custom_loss(y_true, y_pred):
return K.maximum(y_true - y_pred)
File "lib\site-packages\keras\backend\tensorflow_backend.py", line 609, in ndim
dims = x.get_shape()._dims
AttributeError: 'int' object has no attribute 'get_shape'
What's wrong with this? Why am I getting it?