-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Experimenting with adding proper get_config() and from_config() methods #14361
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clean, I like it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice, clean fix.
It would be ideal to add tests to ensure that the model's serialization works correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you, @Rocketknight1
Just a small comment from my side - I think I stumbled across the problem that the returned get_config was not fully JSON serializable (as it contained a reference to a tf DType class) - I circumvented this by adding a custom JSONEncoder for it; but it may be worthwhile testing for json.dumps(config) as well? |
@Zahlii That's a great idea! Would you be willing to write a test for it, or modify the existing test, and tag me for review? |
See #14415 |
…ds (#14361) * Experimenting with adding proper get_config() and from_config() methods * Adding a test for get/from config * Fix test for get/from config
Should fix issues with saving/loading Keras models containing Transformers models as layers, among other problems.