Tensorflow model works but after a while does not work

the story is this , i used tensorflow hub to train a model , then i saved the model with model.save() and used the model with :
my_reloaded_model = tf.keras.models.load_model(
(“./model/model_flower.h5”),
custom_objects={‘KerasLayer’:hub.KerasLayer}
)
and it works fine but after about 1 week when i run the program again it throws an error :
TypeError: Error when deserializing class ‘KerasLayer’ using config={‘name’: ‘keras_layer_1’, ‘trainable’: False, ‘dtype’: ‘float32’, ‘batch_input_shape’: [None, 224, 224, 3], ‘handle’: ‘TensorFlow Hub’}.

Exception encountered: Trying to load a model of incompatible/unknown type. ‘C:\Users\Lenovo\AppData\Local\Temp\tfhub_modules\145bb06ec3b59b08fb564ab752bd5aa222bfb50a’ contains neither ‘saved_model.pb’ nor ‘saved_model.pbtxt’.
I checked for stack overflow and got 1 answer that : "Essentially what I understood from the article above, is that TensorFlow will create a temp directory to keep loaded models; however, after a few days or so, the contents of the folers (the loaded model) will be deleted. Then when you look to load a model again, TensorFlow will route to the temp dir, but the model will be deleted from the temp dir.

This makes sense and explains why if your code is running totally fine the past few days, and then all of the sudden gets this error, it probably has to do with deleting the old temp directory."
This answer worked very well but it was only a temporary response because after few days tensorflow deleted the temp folder again and it didn’t work .
Do you have any way? I mean I don’t want to have to delete that temp directory again to get it running again. I want it to work permanently without constant intervention.
The link stack overflow : python - OSError: SavedModel file does not exist at: C:\Users\Munib\New folder/{saved_model.pbtxt|saved_model.pb} - Stack Overflow

the story is this , i used tensorflow hub to train a model , then i saved the model with model.save() and used the model with :
my_reloaded_model = tf.keras.models.load_model(
(“./model/model_flower.h5”),
custom_objects={‘KerasLayer’:hub.KerasLayer}
)
and it works fine but after about 1 week when i run the program again it throws an error :
TypeError: Error when deserializing class ‘KerasLayer’ using config={‘name’: ‘keras_layer_1’, ‘trainable’: False, ‘dtype’: ‘float32’, ‘batch_input_shape’: [None, 224, 224, 3], ‘handle’: ‘TensorFlow Hub’}.

Exception encountered: Trying to load a model of incompatible/unknown type. ‘C:\Users\Lenovo\AppData\Local\Temp\tfhub_modules\145bb06ec3b59b08fb564ab752bd5aa222bfb50a’ contains neither ‘saved_model.pb’ nor ‘saved_model.pbtxt’.
I checked for stack overflow and got 1 answer that : "Essentially what I understood from the article above, is that TensorFlow will create a temp directory to keep loaded models; however, after a few days or so, the contents of the folers (the loaded model) will be deleted. Then when you look to load a model again, TensorFlow will route to the temp dir, but the model will be deleted from the temp dir.

This makes sense and explains why if your code is running totally fine the past few days, and then all of the sudden gets this error, it probably has to do with deleting the old temp directory."
This answer worked very well but it was only a temporary response because after few days tensorflow deleted the temp folder again and it didn’t work .
Do you have any way? I mean I don’t want to have to delete that temp directory again to get it running again. I want it to work permanently without constant intervention.
The link stack overflow : python - OSError: SavedModel file does not exist at: C:\Users\Munib\New folder/{saved_model.pbtxt|saved_model.pb} - Stack Overflow

@Quat_Tran_Dang,

Welcome to the Tensorflow Forum,

The download location defaults to a local temporary directory but can be customized by setting the environment variable TFHUB_CACHE_DIR (recommended) or by passing the command-line flag --tfhub_cache_dir.

You can also instruct the tensorflow_hub library to directly read models from remote storage (GCS) instead of downloading the models locally with

os.environ["TFHUB_MODEL_LOAD_FORMAT"] = "UNCOMPRESSED"

For more details please refer to Caching model downloads from TF Hub.

Thank you!

so should we retrain the model then it will works?