I'm trying to make keras modelcheckpoint code. But Whenever I started the code, that get_config error occured. Below is my keras code.
model = keras.Sequential()
model.add(keras.layers.Flatten(input_shape=(8,)))
model.add(keras.layers.Dense(512))
model.add(LeakyReLU(alpha=0.2))
model.add(keras.layers.Dropout(0.1))
model.add(keras.layers.Dense(1))
model.compile(optimizer = keras.optimizers.Adam(learning_rate =0.0001),
loss = keras.losses.MeanSquaredError(reduction="auto"),
metrics = 'mae')
mc2 = keras.callbacks.ModelCheckpoint('best_model_scaled'+str(fold_no)+'.h5',
monitor='val_loss', mode='min', save_best_only=True,verbose=1)
es=keras.callbacks.EarlyStopping(monitor='val_loss', mode='min', patience=1500)
history = model.fit(x_train2, y_train2, batch_size=16,epochs=2000, validation_data = (x_val2, y_val2), callbacks = [es,mc2])
I saw other questions and found that "def get_config(self):" code solves the problem. But I have no "Class():" code for "get_config(self)". Please help me solve the problem. Thanks!