I've read through similar questions on this and am still stumped. On the same computer, I am training a model and saving with
model.save(model_location)
type(model)
keras.engine.functional.Functional
Then, I am loading the model with
model = keras.models.load_model(model_location)
# model = tf.saved_model.load(model_location) results in the same
type(model)
<class 'tensorflow.python.saved_model.load.Loader._recreate_base_user_object.<locals>._UserObject'>
and getting the following error when calling model.predict(X)
AttributeError: '_UserObject' object has no attribute 'predict'
tf.saved_model.contains_saved_model(model_location)
true
tensorflow-gpu == 2.7.0 keras == 2.8.0
This is on Windows, and the same environment on my Linux machine does not produce this error.
Thanks in advance!