-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Sequential Model Save/Load Problems #755
Comments
I guess this is the issue. But this is also not resolved tensorflow/tensorflow#31927 |
The issue is not resolved on my side as well. Can someone from the tensorflow team take a look and help with this? |
I have managed to understand several serialisation issues in TF more deeply. It seams that everything related to preprocessing layers or some custom losses or custom function is not getting well serialised -> or I should rather say rendered by the tool called These issues were finally solved in TF 2.4 but reappeared magically again in TF 2.5 -> so the only version I can actually work with and use this kind of model is TF2.4. If you are interested in some more details about this kind of model or problems with related architecture -> do not hesitate to contact me directly. (If enough people will be interested I can publish a blog about my deep dive into this isse and all the solutions I have implemented) Have fun! |
This looks like continues to be a problem with saving TensorFlow probability layers as indicated previously. I was not able to read in a saved model so switched to building a model and reading weights. This worked with a model with a tfp.layers.DistributionLambda layer. However I now have a model with a tfp.layers.DenseVariational layer and reading weights now also fails. Wondering if this has been fixed or there is a workaround:- I am using:- tensorflow 2.7.0 Traceback (most recent call last): |
@JohnTaylor2000 Hello, I have the same problem, could I have any tips please |
The issue was fixed in the TF version > 2.6 (if I remember well) so if you use the latest version this same model works ! ;) Hope this helps |
Thanks,That really works |
I have a Tensorflow 2.x model which is using the TF preprocessing layer (tf.keras.layers.DenseFeatures) and the distributional layer from TF probability (DistributionLambda)
I can get some nice results for the regression problem with this model, but when I save it for further use I can't load it back anymore (I have tried all online tutorials and solutions, but nothing is working)!!
I can save it to a file (h5, tf, json etc...)
i.e.:
but when loading I get:
I can't figure out what am I doing wrong - any help would be appreciated!
Also, I have tried all possible save extensions and backends: h5, tf, json, simple weights and other formats but none of them works ... I have even tried to do it on different systems: Mac, Ubuntu and on different Tensorflow versions: 2 and 2.1 ...
Of course, all the saving and loading works great for other models I use without the TF Probability layer (even the ones with a DenseFeatures layer).
The text was updated successfully, but these errors were encountered: