Skip to content

Do I need to implement deserialization myself for Sequential? #1407

Answered by antimora
zemelLeong asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry about the bad error message. We will improve it and thanks for filing a bug (#1390).

No, you do not need to implement any deserialization. You just need to match the keys. If you need to adjust the keys, you can use key remap. Please see this book section: https://burn.dev/book/import/pytorch-model.html#adjusting-the-source-model-architecture.

In your example, you have new layers attribute in your model but not in the source. So you'll need to add layers before wh. Basically, you'll need to replace model.wh to model.wh.layers. I recommend this online regex tool that works for Rust regex: https://rregex.dev/?version=1.10&method=replace

Hope this helps!

P.S. The book online is for Bur…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zemelLeong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants