-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
_restructure
as part of the public API?
#1624
Comments
There's some limitations and potential work to fix them eg #1353 There's also some issues with holding on to some stateful fields in RNNs |
Ah, good to know. Do you think |
Yes, destructure currently has the same problem as |
There are reasons to want that, esp when your recipient models isn't the same structure as the model which generated the params, which is useful for loading into backbones and such, but that's separate. |
Right, my point is that making |
Makes sense; in my case we aren't using stateful layers AFAIK so the current behavior is fine; even
is ok. Just want a simple (de)-serialization path for loading weights back into same model without scary non-local bugs like BSON's JuliaIO/BSON.jl#75 😄 . Currently using the Serialization stdlib for some models but that is very finnicky with presence/absence of anonymous functions in the (de)-serialization environment, and of course not robust to Julia minor version bumps. |
As an aside, seems bson has been buggy recently with anonymous functions.
Not sure about this? Should be about equivalent to loadparams if the saved params were in a vector for some reason. |
This is what What I'm trying to avoid by making |
Ah cool, I didn’t realize this. I think that covers this use case, so I’ll close this. Thanks for the quick feedback from both of you! |
destructure
seems like a convienent way to extract model weights to serialize out, but it's unfortunate the mechanism to reload them is a callback (which is not easy to serialize). Would it be possible to make_restructure
part of the public API so it can be relied on to reload weights?The text was updated successfully, but these errors were encountered: