I could save weights in each epoch during training using keras R. I have attached code for callback_model_checkpoints() and fit() -
# callbacks to save weights in each epoch
callback_model_checkpoint(
filepath = "weights.{epoch:02d}-{val_acc:.2f}.hdf5",
monitor = "val_loss",
verbose = 0,
save_best_only = TRUE,
save_weights_only = TRUE,
mode = c("auto", "min", "max"),
period = NULL,
save_freq = "epoch"
)
# fitting the model on the training dataset
model %>%
fit(train_x, train_y,
epochs = 150, batch_size = 1024,
validation_split = 0.2, verbose = 0,
callbacks = list(callback_model_checkpoint("checkpoints.h5")))
But how do I load the weights for further diagnosis? I can see a file 'checkpoints.h5' in the working folder.