Skip to content
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

PyTorch weights support #472

Closed
ardeal opened this issue Apr 22, 2020 · 3 comments
Closed

PyTorch weights support #472

ardeal opened this issue Apr 22, 2020 · 3 comments

Comments

@ardeal
Copy link

ardeal commented Apr 22, 2020

Hi,

I use Netron tool to visualize the pth file from the following link:
https://download.pytorch.org/models/vgg19_bn-c79401a0.pth

If I use Netron tool to visualize some other format file, there are arrow-lines to connect each layer of the network.

but the visualized output network of pth file seems not correct. there is no arrow-lines to connect each layer....

Thanks,
Ardeal

@lutzroeder lutzroeder marked this as a duplicate of #133 Apr 22, 2020
@ardeal
Copy link
Author

ardeal commented Apr 22, 2020

@lutzroeder ,
Hi,

I am still confused about how to convert the pth file to onnx file.

at present, I do save the pth file with code:
torch.save(model.state_dict(), filepath)

according to #133 , I got 2 understandings:

  1. re-train the model and save the pth file with code: torch.save(model, filepath)
  2. don't need to re-train the model. I need to use some code to convert the pth file to onnx file. what the code should be? is there any example code?

which of my upper understandings is correct?

Thanks,
Ardeal

@lutzroeder lutzroeder changed the title visualize pth file of Pytorch PyTorch weights support Jun 12, 2020
@lutzroeder lutzroeder marked this as a duplicate of #359 Jun 12, 2020
lutzroeder added a commit that referenced this issue Oct 25, 2020
@lutzroeder
Copy link
Owner

wget https://api.ngc.nvidia.com/v2/models/nvidia/megatron_bert_345m/versions/v0.1_cased/zip -O megatron_bert_345m_v0.1_cased.zip

@lutzroeder
Copy link
Owner

Duplicate of #720

@lutzroeder lutzroeder marked this as a duplicate of #720 Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants