Pytorch 模型查看

def count_parameters(model): return sum(p.numel() for p in model.parameters() if p.requires_grad)print("模型的参数量", count_parameters(model)) print("model",model) from torchsummary import summary print(summary(model, (input_data.shape[1])))

    推荐阅读