Are you seeing this issue also while directly executing the model or only when using the summary?
In the latter case I would guess the summary package might not be compatible with your PyTorch version or could have a known issue.
Also, I don’t know which summary library you are using, but note that e.g. pytorch-summary 5 seems to be deprecated in favor of torchinfo 8.