I'm getting None type when reshaping the tensor. This happens when compiling the model with loss function and the optimizer (before starting the training). What do I do?
Error:
TypeError: Failed to convert object of type <class 'tuple'> to Tensor. Contents: (None, -1). Consider casting elements to a supported type.
Custom loss function:
def custom_loss(y_true, y_pred):
y_pred = K.reshape(y_pred, (K.get_variable_shape(y_pred)[0], -1))
y_true = K.reshape(y_true, (K.get_variable_shape(y_true)[0], -1))
y_pred = K.std(y_pred, axis=0)
y_true = K.std(y_true, axis=0)
loss = (1/2) * (y_pred - y_true) ** 2
loss = K.mean(loss)
return loss