You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...
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()