Closed Chriisbrown closed 1 year ago
Hi,
this is a known issue, but there is a workaround for most cases.
If your model does not use keras-specifics (e.g. it's not using neural networks preprocessing or model composition), you can create the inspector from the saved model on disk:
# Let's save the model first:
path_to_model = "/tmp/mymodel"
model.save(path_to_model)
# Now create an inspector from the raw YDF model inside our model
insp = tfdf.inspector.make_inspector(os.path.join(path_to_model, "assets"))
When trying to save a trained model and reload it in a separate python file using
model.save(filepath, save_format='tf')
thenmodel = tf.keras.models.load_model(filepath)
I see that the model type has changed, before saving I had a <tensorflow_decision_forests.keras.GradientBoostedTreesModel object at ... >
after loading I have a