...
File "/home/secret/anaconda3/lib/python3.7/site-packages/torchsummary/torchsummary.py", line 23, in <listcomp>
[-1] + list(o.size())[1:] for o in output
AttributeError: 'int' object has no attribute 'size'
I looked into the both the models and the torchsummary and realize that the model implementation returns both the output tensor and the loss value as a tuple. Therefore, when the loss value is passed into the output o.size() will fail.
This can be fix by checking for list and tuple before passing o to o.size()
When I tried to run summary() on a pytorch YOLOv3 implementation an error was thrown:
I looked into the both the models and the torchsummary and realize that the model implementation returns both the output tensor and the loss value as a tuple. Therefore, when the loss value is passed into the output o.size() will fail. This can be fix by checking for list and tuple before passing o to o.size()