AttributeError:'tuple' object has no attribute 'size'

I tried to print out the summary of a simple model I created with LSTM and CNN but I got the error :AttributeError:‘tuple’ object has no attribute ‘size’.
Here is my code :
class lstmCnn_model(nn.Module):

def __init__(self):
    super(lstmCnn_model, self).__init__()
    self.lstm = nn.LSTM(input_size=384, hidden_size=64, batch_first=True, bidirectional=True)
  
    self.layernorm = nn.LayerNorm(128)
    self.conv = nn.Conv1d(in_channels=128, out_channels=64, kernel_size=3)
    
    
def forward(self,x):
    
   
    x = x.view(x.size(0), x.size(2),-1)
    
    x, _ = self.lstm(x)
    
    x = self.layernorm(x)
    
    x = self.conv(x)
    print(x.shape)
    
    
    return x

model = lstmCnn_model()
model.to(device)
print(model)
summary(model, input_size= (3,128,128))

Your code works for me after fixing the wrong input shape:

class lstmCnn_model(nn.Module):
    def __init__(self):
        super(lstmCnn_model, self).__init__()
        self.lstm = nn.LSTM(input_size=384, hidden_size=64, batch_first=True, bidirectional=True)
        self.layernorm = nn.LayerNorm(128)
        self.conv = nn.Conv1d(in_channels=128, out_channels=64, kernel_size=3)
        
    def forward(self,x):
        x = x.view(x.size(0), x.size(2),-1)
        x, _ = self.lstm(x)
        x = self.layernorm(x)
        x = self.conv(x)
        print(x.shape)
        return x


model = lstmCnn_model()
print(model)

from torchinfo import summary
summary(model, input_size= (3,128,128))
# RuntimeError: Failed to run torchinfo. See above stack traces for more details. Executed layers up to: []

summary(model, input_size= (3,384,128))
# ==========================================================================================
# Layer (type:depth-idx)                   Output Shape              Param #
# ==========================================================================================
# lstmCnn_model                            [3, 64, 126]              --
# ├─LSTM: 1-1                              [3, 128, 128]             230,400
# ├─LayerNorm: 1-2                         [3, 128, 128]             256
# ├─Conv1d: 1-3                            [3, 64, 126]              24,640
# ==========================================================================================
# Total params: 255,296
# Trainable params: 255,296
# Non-trainable params: 0
# Total mult-adds (M): 97.79
# ==========================================================================================
# Input size (MB): 0.59
# Forward/backward pass size (MB): 0.98
# Params size (MB): 1.02
# Estimated Total Size (MB): 2.59
# ==========================================================================================

Thank you. Using summary from torchinfo it work.