PyTorch: torchsummary for loaded model

Maybe you should instantiate it when you use summary function to show it.
Try like this

model_dict = torch.load('results/model_best.pth.tar')
model = YourModel() #Your Model Class Here
model.load_state_dict(model_dict)
summary(model, (3, 224, 224)) 
1 Like