'When keras tuner save best model,comes the Unsuccessful TensorSliceReader constructor error

I was using Keras Tuner to find the best model, but I found an error when saving the best model, this is my problem:

error image 1

error image 2

and here is my tuner:

tuner = kt.BayesianOptimization(
    hypermodel=build_model,
    objective="val_loss",
    max_trials=300,
    alpha=0.0001,
    beta=2.6,
    seed=None,
    overwrite=True,
    hyperparameters=None,
    tune_new_entries=True,
    allow_new_entries=True,
    directory="my_dir",
    project_name="BayesianOptimization_ols_BN_std",
)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source