-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't save and load lattice model #77
Comments
when I changed the version to 2.0.11, the keras failed with the error below and tf passed
|
Try rtl_layer_ensemble_model.save("model_keras")
loaded_model = tf.keras.models.load_model(
"model_keras",
custom_objects=tfl.premade.get_custom_objects(),
)
rtl_layer_ensemble_model.save("model_keras")
loaded_model = tf.saved_model.load("model_keras")
|
thank you for the suggestion load_model with custom_objects=tfl.premade.get_custom_objects() doesn't throw error for when load model save with .save("model.tf") and .save("model")
however in version 2.0.13, the loaded model with custom_objects gave the following error when call .evaluate(x, y), .predict(x) seems to work
in version 2.0.11, saved and loaded model can call .evaluate(x, y) escaping period doesn't seems to do anything or is there any special syntax for escape period besides |
Hi, I am also having a problem with loading my tensorflow model with a Lattice layer. My model was able to compile and predict without a problem, and I saved it to json. I used model_from_json to load the saved model but I am getting an error about the lattice sizes:
|
Hi @expeon07 in case the problem still persists could you provide a full stack trace? |
We just release TFL 2.1.1 with a fix for this. Can you please try to see if you can load without an issue? |
hello, I'm having a problem with loading premade models (https://www.tensorflow.org/lattice/tutorials/premade_models)
when I save the model as .tf format and load the model I would get
when I save the model as keras format and load the model I would get
I'm seeing this issue running on the colab given by the page (https://colab.research.google.com/github/tensorflow/lattice/blob/master/docs/tutorials/premade_models.ipynb), on Databricks, and also local run
code I use to save and load the model (https://www.tensorflow.org/lattice/api_docs/python/tfl/premade/CalibratedLattice#save)
all the models in the example can't be loaded
full stacktrace error:
The text was updated successfully, but these errors were encountered: