Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from model import(
- MyNet,
- )
- import numpy
- import torch
- device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
- net = MyNet()
- net = net.to(device)
- ckpt = torch.load("modelWeight.pth.tar")
- net.load_state_dict(ckpt["state_dict"])
- for layer in net.modules():
- if isinstance(layer,torch.nn.modules.batchnorm.BatchNorm2d):
- print(layer.weight)
Advertisement
Add Comment
Please, Sign In to add comment