NMOSFET

Untitled

Apr 9th, 2022
1,985
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. from model import(
  2. MyNet,
  3. )
  4. import numpy
  5. import torch
  6.  
  7. device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
  8. net = MyNet()
  9. net = net.to(device)
  10. ckpt = torch.load("modelWeight.pth.tar")
  11. net.load_state_dict(ckpt["state_dict"])
  12.  
  13. for layer in net.modules():
  14. if isinstance(layer,torch.nn.modules.batchnorm.BatchNorm2d):
  15. print(layer.weight)
Advertisement
Add Comment
Please, Sign In to add comment