sksq96 / pytorch-summary

Model summary in PyTorch similar to `model.summary()` in Keras
MIT License
4.01k stars 412 forks source link

Summary not working foe DeepLabv3 #154

Closed Walid-Ahmed closed 3 years ago

Walid-Ahmed commented 3 years ago

I tried the pytorch-summary on deeplabv3_resnet101

model = models.segmentation.deeplabv3_resnet101(pretrained=1).eval()  #The .eval method will load it in inference mode.
summary(model, (3, 224, 224))

I goth the following error: File "/Users/walidahmed/anaconda2/envs/pytorchEnv/lib/python3.7/site-packages/torchsummary/torchsummary.py", line 26, in hook summary[m_key]["output_shape"] = list(output.size()) AttributeError: 'collections.OrderedDict' object has no attribute 'size'

I think this is because the output is an collections.OrderedDict but I do not know how to solve it.

Can anyone please help?

Walid-Ahmed commented 3 years ago

Solved when I used the last version,