Closed AppleJoker94 closed 1 year ago
inputs = torch.tensor([128, 56, 56],[256, 28, 28],[512, 14, 14])
model = ... # your model
summary(model, input_data=inputs)
Since the forward
function just takes a single tensor that is then split into three in there, this should work.
I changed it, but sadly, it seems difficult to apply to Tuple.
So I modified the forward function and the problem was solved.
Thank you.
def forward(self, x1, x2, x3) -> Tensor:
l0 = self.conv1(x1)
l1 = self.conv2(l0)
l2 = self.conv3(x2)
feature = torch.cat([l1, l2, x3],1)
out = self.oce_block(feature)
return out
but I can't use summary from torchsummary import summary summary(bn,([128, 56, 56],[256, 28, 28],[512, 14, 14]), batch_size=64)
TypeError Traceback (most recent call last) Cell In[28], line 3 1 from torchsummary import summary ----> 3 summary(bn, input_data=[inputs[0], inputs[1],inputs[2]])
TypeError: summary() got an unexpected keyword argument 'input_data'
Can I use summary with tuple input? (len(inputs) = 3)