Most likely the feature dimension of an intermediate activation doesn’t match the in_features of a linear layer.
Could you post your model definition and if possible an executable code snippet so that we could debug the issue?