-1

I am using weights = torch.load('file_name.pt') to read weights from a .pt file because I want to use the weights obtained to implement this neural network. When I do this and display the weights by calling weights, there are some weights which are not completely displayed and shortened by ellipsis. How do I read all the weight values in the .pt files? Is there any way in by which I can print the values a particular layer like L2.0.weight? Ellipsis being shown in .pt file while using torch.load

Thanks!

  • 1
    Possible duplicate: https://stackoverflow.com/questions/44311664/print-numpy-array-without-ellipsis, or https://pytorch.org/docs/stable/generated/torch.set_printoptions.html – jhso Jan 23 '23 at 13:03
  • [Please don't post screenshots of text](https://meta.stackoverflow.com/a/285557/354577). They can't be searched or copied, or even consumed by users of adaptive technologies like screen readers. Instead, paste the code as text directly into your question, then select it and click the code block button. – ChrisGPT was on strike Mar 03 '23 at 03:45

1 Answers1

-1

You read all the weights the ellipsis is only for display purposes.

Shai
  • 111,146
  • 38
  • 238
  • 371
  • I don't think that is true for this case. I am pretty sure the entries are omitted at some places where there are ellipses. – Shweta Kiran Mar 02 '23 at 12:25