I am using the following code:
from torchsummaryX import summary
model_1 = model_1.to(device) # moving the model to device
summary(model_1, x.flatten(start_dim=0).to(device))
Here the input x
represents the MNIST digit recognition dataset. I am getting the following error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-67-9a265e433028> in <cell line: 43>()
41 model_1 = model_1.to(device)
42
---> 43 summary(model_1, x.flatten(start_dim=0).to(device))
12 frames
/usr/local/lib/python3.10/dist-packages/numpy/core/_methods.py in _sum(a, axis, dtype, out, keepdims, initial, where)
47 def _sum(a, axis=None, dtype=None, out=None, keepdims=False,
48 initial=_NoValue, where=True):
---> 49 return umr_sum(a, axis, dtype, out, keepdims, initial, where)
50
51 def _prod(a, axis=None, dtype=None, out=None, keepdims=False,
TypeError: can only concatenate list (not "str") to list
I checked the output of x.flatten(start_dim=0).to(device)
and got the following:
tensor([0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,
.
.
.
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,
0.0000], device='cuda:0')
Thank you for your response.