pytorch 获取层权重,对特定层注入hook, 提取中间层输出的方法 如下所示:#获取模型权重fork,vinmodel_2.state_dict().iteritems():print("Layer{}".format(k))print(v)#获取模 层权重