Skip to content

Does burn have a converter from PTH file #1465

Answered by laggui
longzou asked this question in Q&A
Discussion options

You must be logged in to vote

Yes! We have PyTorchFileRecorder (see reference in the book).

Since PyTorch saves a (flattened) state dictionary without any model structure definition, you need to define the model in Burn to import the weights you want to reuse.

Shameless plug: if you're looking to port your model over to Burn, take a look at this tutorial to port the torchvision ResNet weights to the Burn implementation.

If you don't want to redefine the model in Burn, you can also try to import the ONNX model directly. Since ONNX captures the weights and operations graph, we can automatically generate the module definition.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by antimora
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1463 on March 12, 2024 15:18.