I am building a model in pytorch
When I try to do:
from torchsummary import summary
summary(model.to(device),((3,224,224)),10)
it gives:
AttributeError                            Traceback (most recent call last)
 in ()
1 import numpy
2 from torchsummary import summary
----> 3 summary(SegNet2(3).to(device),((3,224,224)),10)
/usr/local/lib/python3.6/dist-packages/torchsummary/torchsummary.py in summary(model, input_size, batch_size, device)
100     total_input_size = abs(np.prod(input_size) * batch_size * 4. / (1024 ** 2.))
101     total_output_size = abs(2. * total_output * 4. / (1024 ** 2.))  # x2 for gradients
–> 102     total_params_size = abs(total_params.numpy() * 4. / (1024 ** 2.))
103     total_size = total_params_size + total_output_size + total_input_size
104
AttributeError: ‘int’ object has no attribute ‘numpy’
Even though my model.parameters list contains 2 elements: A '‘last_conv_block.weight’
param and a ‘last_conv_block.bias’ param both with requires_grad = True