1、print(backbone)
参考链接:https://blog.csdn.net/DongxueB/article/details/125054154
2、from torchsummary import summary summary(backbone,(3,112,112))
from torchsummary import summary
summary(backbone, input_size=(channels, H, W))
input_size是输入数据。比如输入一张图片大小为28*28的RGB(3个通道)的图片。那么input_size=(3,28,28),模型是根据你输入的大小来输出中间过程的模型尺寸。而且这里不能输入多张比如input_size(8, 3, 28, 28)。
参考链接:https://blog.csdn.net/weixin_40244676/article/details/116720997
3、 for name, param in backbone.named_parameters():
if param.requires_grad:
print(“-----model.named_parameters()–{}:{}”.format(param, “”))
参考链接:https://blog.csdn.net/hxxjxw/article/details/107717031?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-107717031-blog-103630382.pc_relevant_default&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-107717031-blog-103630382.pc_relevant_default&utm_relevant_index=2