TylerYep/torchinfo

Why no input shape?

xhxlab opened this issue · 3 comments

Here is the result of my output, why is it different from your example, your example will also limit the input shape, I have only output

==========================================================================================
Layer (type:depth-idx)                   Output Shape              Param #
==========================================================================================
Sequential                               [32, 1]                   --
├─Residual: 1-1                          [32, 12, 5]               --
│    └─Conv1d: 2-1                       [32, 12, 5]               72
│    └─Conv1d: 2-2                       [32, 12, 5]               444
│    └─Conv1d: 2-3                       [32, 12, 5]               24
├─Residual: 1-2                          [32, 12, 5]               --
│    └─Conv1d: 2-4                       [32, 12, 5]               732
│    └─Conv1d: 2-5                       [32, 12, 5]               444
├─AvgPool1d: 1-3                         [32, 12, 3]               --
├─Residual: 1-4                          [32, 16, 2]               --
│    └─Conv1d: 2-6                       [32, 16, 2]               976
│    └─Conv1d: 2-7                       [32, 16, 2]               784
│    └─Conv1d: 2-8                       [32, 16, 2]               208
├─Residual: 1-5                          [32, 16, 2]               --
│    └─Conv1d: 2-9                       [32, 16, 2]               1,296
│    └─Conv1d: 2-10                      [32, 16, 2]               784
├─MaxPool1d: 1-6                         [32, 16, 3]               --
├─Flatten: 1-7                           [32, 48]                  --
├─Linear: 1-8                            [32, 12]                  588
├─ReLU: 1-9                              [32, 12]                  --
├─Linear: 1-10                           [32, 1]                   13
==========================================================================================
Total params: 6,365
Trainable params: 6,365
Non-trainable params: 0
Total mult-adds (M): 0.55
==========================================================================================
Input size (MB): 0.00
Forward/backward pass size (MB): 0.12
Params size (MB): 0.03
Estimated Total Size (MB): 0.15
==========================================================================================

Can you post the code you are using? It sounds like you need to specify the col_names param and give it the columns you want. See docs for details.

Can you post the code you are using? It sounds like you need to specify the col_names param and give it the columns you want. See docs for details.

result = summary(net, input_size=input_size)

result = summary(net, input_size=input_size, col_names=("input_size", "output_size", "num_params"))