I have a Lambda layer that takes input from previous layer, makes some preprocessing. Output of the Lambda layer is a prediction, and keras.losses.mean_squared_error is used.
#model
inputs = Input(shape=(len_train_data_columns,))
dense1 = Dense(777, activation='relu')(inputs)
dropout1 = Dropout(0.4)(dense1)
softmax = Dense(3, activation='softmax')(dropout1)
predictions = Lambda(custom_layer,
output_shape= custom_layer_output_shape,
arguments= {'experiment_config': experiment_config},
)(softmax)
model = Model(inputs = inputs, outputs = predictions)
model.compile(optimizer=adam(lr=0.0001), loss=keras.losses.mean_squared_error, metrics=keras.losses.mean_squared_error)
Output of Lambda is (num_rows, 1).
I get ValueError: An operation has None
for gradient. Please make sure that all of your ops have a gradient defined (i.e. are differentiable). Common ops without gradient: K.argmax, K.round, K.eval.
Why is that? I use Keras loss...