一、安装torchsummary库 pip install torchsummary 二、代码 import torchvision.models as models from torchsummary import summarymodel = models.AlexNet() model.to('cuda') summary(model,(3,224, 224))